diff options
Diffstat (limited to 'comms/scmxx/files/patch-src_pinfile.c')
-rw-r--r-- | comms/scmxx/files/patch-src_pinfile.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/comms/scmxx/files/patch-src_pinfile.c b/comms/scmxx/files/patch-src_pinfile.c new file mode 100644 index 000000000000..6a48a2dfbe97 --- /dev/null +++ b/comms/scmxx/files/patch-src_pinfile.c @@ -0,0 +1,23 @@ + +$FreeBSD$ + +--- src/pinfile.c.orig ++++ src/pinfile.c +@@ -21,6 +21,17 @@ + #include <limits.h> + #include <ctype.h> + ++char* strndup(const char *str, size_t len) { ++ size_t copy_len=(strlen (str) > len) ? strlen(str): len; ++ char *new = (char *) malloc (copy_len + 1); ++ ++ if (new == NULL) ++ return NULL; ++ ++ new[copy_len] = '\0'; ++ return (char *) memcpy (new, str, copy_len); ++} ++ + char* pinfile_get_data (char* filename) { + int fd = open(filename,O_RDONLY); + struct stat fdstat; |