From 427614f89ffa407f028db2d8ab3aedccacac23ca Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Wed, 28 Aug 2013 14:03:53 -0700 Subject: [PATCH] document an assumption --- src/deps_log.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/deps_log.cc b/src/deps_log.cc index a5d726c..64ef58f 100644 --- a/src/deps_log.cc +++ b/src/deps_log.cc @@ -234,6 +234,7 @@ bool DepsLog::Load(const string& path, State* state, string* err) { ++unique_dep_record_count; } else { int path_size = size - 4; + assert(path_size > 0); // CanonicalizePath() rejects empty paths. // There can be up to 3 bytes of padding. if (buf[path_size - 1] == '\0') --path_size; if (buf[path_size - 1] == '\0') --path_size; -- 2.7.4