diff options
Diffstat (limited to 'Build/source/libs/zziplib/zziplib-src/bins/unzzipcat-zip.c')
-rw-r--r-- | Build/source/libs/zziplib/zziplib-src/bins/unzzipcat-zip.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Build/source/libs/zziplib/zziplib-src/bins/unzzipcat-zip.c b/Build/source/libs/zziplib/zziplib-src/bins/unzzipcat-zip.c index 72d89cdb5d6..750c95f6345 100644 --- a/Build/source/libs/zziplib/zziplib-src/bins/unzzipcat-zip.c +++ b/Build/source/libs/zziplib/zziplib-src/bins/unzzipcat-zip.c @@ -43,6 +43,22 @@ static void unzzip_cat_file(ZZIP_DIR* disk, char* name, FILE* out) } } +#if !defined(ZZIP_HAVE_STRNDUP) +static char * +strndup(char *p, size_t maxlen) +{ + char *r; + if (!p) + return NULL; + r = malloc(maxlen + 1); + if (!r) + return NULL; + strncpy(r, p, maxlen); + r[maxlen] = '\0'; + return r; +} +#endif + static FILE* create_fopen(char* name, char* mode, int subdirs) { if (subdirs) |