source: trunk/dports/print/gv/files/patch-secscanf.c.diff @ 40242

Last change on this file since 40242 was 40241, checked in by ryandesign@…, 12 years ago

gv: update to 3.6.6, including patch from https://savannah.gnu.org/bugs/?24380

File size: 498 bytes
  • src/secscanf.c

     
    3232#include <string.h>
    3333#include <ctype.h>
    3434
     35size_t strnlen(const char *s, size_t len)
     36{
     37size_t i;
     38for(i=0; i<len && *(s+i); i++);
     39return i;
     40}
     41char* strndup (char const *s, size_t n)
     42{
     43size_t len = strnlen (s, n);
     44char *new = malloc (len + 1);
     45if (new == NULL)
     46return NULL;
     47new[len] = '\0';
     48return memcpy (new, s, len);
     49}
     50
    3551enum {
    3652        CONV_ANY,
    3753        CONV_STR,
Note: See TracBrowser for help on using the repository browser.