From 0e4637025fa8d1b4234b0512561d31f0dd023843 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 15 Oct 2010 12:26:14 +0200 Subject: Allow initialization with NULL C-string --- libxsde/xsde/cxx/ro-string.ixx | 6 +++--- 1 file 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:: -- cgit v1.1