summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2013-06-26 22:03:24 -0700
committerBen Longbons <b.r.longbons@gmail.com>2013-06-26 22:03:24 -0700
commite7df670f4ed2a289bdedd6e6086e33b382067016 (patch)
tree3408bf1ed57892e77f36e4c277e42dd4a11246b5
parentd4630b8686f2f481c470cf35a2c19128a24344d4 (diff)
downloadtmwa-e7df670f4ed2a289bdedd6e6086e33b382067016.tar.gz
tmwa-e7df670f4ed2a289bdedd6e6086e33b382067016.tar.bz2
tmwa-e7df670f4ed2a289bdedd6e6086e33b382067016.tar.xz
tmwa-e7df670f4ed2a289bdedd6e6086e33b382067016.zip
Don't crash for another thing that probably shouldn't happen, but does
-rw-r--r--src/common/dumb_ptr.hpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/common/dumb_ptr.hpp b/src/common/dumb_ptr.hpp
index d9000e9..8863ef2 100644
--- a/src/common/dumb_ptr.hpp
+++ b/src/common/dumb_ptr.hpp
@@ -219,7 +219,8 @@ struct dumb_string
dumb_string fake(const char *p)
{
dumb_string rv;
- rv.impl = dumb_ptr<char[]>(const_cast<char *>(p), strlen(p));
+ size_t len = p ? strlen(p) : 0;
+ rv.impl = dumb_ptr<char[]>(const_cast<char *>(p), len);
return rv;
}