diff options
Diffstat (limited to 'ArchiveEx/Archive.cpp')
-rw-r--r-- | ArchiveEx/Archive.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ArchiveEx/Archive.cpp b/ArchiveEx/Archive.cpp index c6e4e97..ad29c92 100644 --- a/ArchiveEx/Archive.cpp +++ b/ArchiveEx/Archive.cpp @@ -186,7 +186,9 @@ Archive::Insert(const char* filepath) blocks.resize(destination_block + total_blocks, UNUSED_BLOCK); for (std::size_t i = destination_block; i < destination_block + total_blocks; ++i) blocks[i] = index; - std::strcpy(entries[index].name, filepath); + auto normalized_path = std::make_unique<char[]>(std::strlen(filepath) + 1); + ConvertPathSeparator(filepath, normalized_path.get()); + std::strcpy(entries[index].name, normalized_path.get()); entries[index].original_size = uncompressed_size; entries[index].compressed_size = compressed_size; entries[index].offset = destination_block * BLOCK_SIZE; |