misc/libphysfs/archiver_zip.c
changeset 12451 30da743f118b
parent 12213 bb5522e88ab2
child 12452 e18cfe90e4e2
--- a/misc/libphysfs/archiver_zip.c	Fri Sep 01 11:24:18 2017 -0400
+++ b/misc/libphysfs/archiver_zip.c	Sun Sep 03 19:09:30 2017 +0200
@@ -972,8 +972,8 @@
         BAIL_IF_MACRO(!retval, PHYSFS_ERR_OUT_OF_MEMORY, NULL);
         memset(retval, '\0', sizeof (*retval));
         retval->name = ((char *) retval) + sizeof (ZIPentry);
-        memcpy(retval->name, name, namelen);
-        retval->name[namelen] = '\0';
+        memcpy(retval->name, name, namelen - 1);
+        retval->name[namelen - 1] = '\0';
         retval->resolved = ZIP_DIRECTORY;
         if (!zip_hash_entry(info, retval))
         {