Skip to content

Commit c9512a8

Browse files
authored
Fix unpackFiles bug
pos is of size_t, which can be (and almost always is) unsigned (mingw-32 for example); so (pos > 0) is always true even if name does not contain '/' as a result, unpackFiles always creates empty dirs instead of write to file(s)
1 parent b7ff183 commit c9512a8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ bool unpackFiles(std::string sDest) {
365365
size_t pos = name.find_last_of("/");
366366

367367
// If file is in sub directory?
368-
if (pos > 0) {
368+
if (pos != std::string::npos) {
369369
// Subdir path.
370370
std::string path = sDest;
371371
path += name.substr(0, pos);

0 commit comments

Comments
 (0)