diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2010-10-15 12:26:14 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2010-10-15 12:26:14 +0200 |
commit | 0e4637025fa8d1b4234b0512561d31f0dd023843 (patch) | |
tree | f8d797b45da9b9826853fa1fcee4f9cd3c0e44e2 /libxsde | |
parent | fac1bf0b0db4aa90472a2dd06c646af145e059a5 (diff) |
Allow initialization with NULL C-string
Diffstat (limited to 'libxsde')
-rw-r--r-- | libxsde/xsde/cxx/ro-string.ixx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libxsde/xsde/cxx/ro-string.ixx b/libxsde/xsde/cxx/ro-string.ixx index 35a7e3d..cf37c81 100644 --- a/libxsde/xsde/cxx/ro-string.ixx +++ b/libxsde/xsde/cxx/ro-string.ixx @@ -17,7 +17,7 @@ namespace xsde inline ro_string:: ro_string (const char* s) - : data_ (s), size_ (strlen (s)) + : data_ (s), size_ (s ? strlen (s) : 0) { } @@ -81,7 +81,7 @@ namespace xsde assign (const char* s) { data_ = s; - size_ = strlen (s); + size_ = s ? strlen (s) : 0; } inline void ro_string:: @@ -123,7 +123,7 @@ namespace xsde inline int ro_string:: compare (const char* str) const { - return compare (str, strlen (str)); + return compare (str, str ? strlen (str) : 0); } inline int ro_string:: |