diff options
author | Evan Martin <martine@danga.com> | 2012-01-23 22:19:42 (GMT) |
---|---|---|
committer | Evan Martin <martine@danga.com> | 2012-01-23 22:19:42 (GMT) |
commit | 9101fb077be10d74bc0f165cc2c327a9190e3eb6 (patch) | |
tree | 3de6f5cb27d5147302dc62f57327a9d69d752717 /src | |
parent | 114568aa52ab30f8be851d88e3c51f79b2aaa0bc (diff) | |
parent | 62e9139740950c9a9bf1397922691e956b629f2f (diff) | |
download | Ninja-9101fb077be10d74bc0f165cc2c327a9190e3eb6.zip Ninja-9101fb077be10d74bc0f165cc2c327a9190e3eb6.tar.gz Ninja-9101fb077be10d74bc0f165cc2c327a9190e3eb6.tar.bz2 |
Merge pull request #204 from syntheticpp/parser-crash
Fix parser crash
Diffstat (limited to 'src')
-rw-r--r-- | src/util.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/util.cc b/src/util.cc index 9f538b9..1dd9838 100644 --- a/src/util.cc +++ b/src/util.cc @@ -79,7 +79,10 @@ void Error(const char* msg, ...) { bool CanonicalizePath(string* path, string* err) { METRIC_RECORD("canonicalize str"); int len = path->size(); - if (!CanonicalizePath(&(*path)[0], &len, err)) + char* str = 0; + if (len > 0) + str = &(*path)[0]; + if (!CanonicalizePath(str, &len, err)) return false; path->resize(len); return true; |