diff options
Diffstat (limited to 'src/common/dumb_ptr.hpp')
-rw-r--r-- | src/common/dumb_ptr.hpp | 3 |
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; } |