summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Nathan Woods <npwoods@mess.org>2016-07-29 22:20:53 -0400
committer Nathan Woods <npwoods@mess.org>2016-07-29 22:20:53 -0400
commitbfbc8d38f1713dacc440134e5ceb710ed3c6a0d1 (patch)
treed0c70a7f4681b4302db9a6005ead2effe9301e68
parent8db549176341312d9182a410c2ffb1b5dd014229 (diff)
Another correction
-rw-r--r--src/lib/util/zippath.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/util/zippath.cpp b/src/lib/util/zippath.cpp
index 0cf65a9f3b8..1eb2eba9274 100644
--- a/src/lib/util/zippath.cpp
+++ b/src/lib/util/zippath.cpp
@@ -117,8 +117,8 @@ static void parse_parent_path(const std::string &path, std::string::size_type *b
std::string::size_type pos;
// skip over trailing path separators
- pos = length - 1;
- while ((pos > 0) && is_path_separator(path[pos]))
+ pos = length ? (length - 1) : std::string::npos;
+ while ((pos > 0) && (pos != std::string::npos) && is_path_separator(path[pos]))
pos--;
// return endpos