misc/libphysfs/archiver_zip.c
changeset 12451 30da743f118b
parent 12213 bb5522e88ab2
child 12452 e18cfe90e4e2
equal deleted inserted replaced
12450:8e32d540dab5 12451:30da743f118b
   970         /* okay, this is a new dir. Build and hash us. */
   970         /* okay, this is a new dir. Build and hash us. */
   971         retval = (ZIPentry *) allocator.Malloc(sizeof (ZIPentry) + namelen);
   971         retval = (ZIPentry *) allocator.Malloc(sizeof (ZIPentry) + namelen);
   972         BAIL_IF_MACRO(!retval, PHYSFS_ERR_OUT_OF_MEMORY, NULL);
   972         BAIL_IF_MACRO(!retval, PHYSFS_ERR_OUT_OF_MEMORY, NULL);
   973         memset(retval, '\0', sizeof (*retval));
   973         memset(retval, '\0', sizeof (*retval));
   974         retval->name = ((char *) retval) + sizeof (ZIPentry);
   974         retval->name = ((char *) retval) + sizeof (ZIPentry);
   975         memcpy(retval->name, name, namelen);
   975         memcpy(retval->name, name, namelen - 1);
   976         retval->name[namelen] = '\0';
   976         retval->name[namelen - 1] = '\0';
   977         retval->resolved = ZIP_DIRECTORY;
   977         retval->resolved = ZIP_DIRECTORY;
   978         if (!zip_hash_entry(info, retval))
   978         if (!zip_hash_entry(info, retval))
   979         {
   979         {
   980             allocator.Free(retval);
   980             allocator.Free(retval);
   981             return NULL;
   981             return NULL;