From 100db087dc8349bff39657e168e8def2e15221b1 Mon Sep 17 00:00:00 2001 From: Adrien Destugues - PulkoMandy Date: Sat, 27 Oct 2012 17:14:55 +0200 Subject: [PATCH] Allow use of c_str() on wstring. --- headers/cpp/std/bastring.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 ()); }