summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrances Buontempo <frances.buontempo@gmail.com>2012-01-03 12:06:24 (GMT)
committerFrances Buontempo <frances.buontempo@gmail.com>2012-01-03 12:06:24 (GMT)
commit036bb5ec764c65eb96d29a64d8c07ba5fbd01b08 (patch)
treee767b0b745906d13f2234a8a4fed3a16b0e224d9
parente2b48cb74186992432af78737772284a852fc56d (diff)
downloadNinja-036bb5ec764c65eb96d29a64d8c07ba5fbd01b08.zip
Ninja-036bb5ec764c65eb96d29a64d8c07ba5fbd01b08.tar.gz
Ninja-036bb5ec764c65eb96d29a64d8c07ba5fbd01b08.tar.bz2
std::string(NULL,0) asserts in MSVC Debug
-rw-r--r--src/string_piece.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/string_piece.h b/src/string_piece.h
index 2f881a2..ad1153e 100644
--- a/src/string_piece.h
+++ b/src/string_piece.h
@@ -43,7 +43,7 @@ struct StringPiece {
/// Convert the slice into a full-fledged std::string, copying the
/// data into a new string.
string AsString() const {
- return string(str_, len_);
+ return len_ ? string(str_, len_) : string();
}
const char* str_;