diff --git a/headers/cpp/std/bastring.h b/headers/cpp/std/bastring.h index b07761e961..774f7be3e9 100644 --- a/headers/cpp/std/bastring.h +++ b/headers/cpp/std/bastring.h @@ -350,7 +350,10 @@ private: public: const charT* c_str () const - { if (length () == 0) return ""; terminate (); return data (); } + { + static const charT null_str[1] = {0}; + if (length () == 0) return null_str; terminate (); return data (); + } void resize (size_type n, charT c); void resize (size_type n) { resize (n, eos ()); }