summaryrefslogtreecommitdiff
path: root/Build/source/libs/zziplib/zziplib-src/bins/unzzipcat-big.c
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/libs/zziplib/zziplib-src/bins/unzzipcat-big.c')
-rw-r--r--Build/source/libs/zziplib/zziplib-src/bins/unzzipcat-big.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/Build/source/libs/zziplib/zziplib-src/bins/unzzipcat-big.c b/Build/source/libs/zziplib/zziplib-src/bins/unzzipcat-big.c
index 5868c4ec5ae..3774939aacb 100644
--- a/Build/source/libs/zziplib/zziplib-src/bins/unzzipcat-big.c
+++ b/Build/source/libs/zziplib/zziplib-src/bins/unzzipcat-big.c
@@ -62,6 +62,22 @@ static void unzzip_cat_file(FILE* 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)