diff options
author | Pixel <pixel@nobis-crew.org> | 2011-11-15 20:57:27 -0800 |
---|---|---|
committer | Pixel <pixel@nobis-crew.org> | 2011-11-15 20:57:27 -0800 |
commit | e2f4752ab5f0e6dba96df8d7c35e102ded57c3f9 (patch) | |
tree | 073fe4bed08bb6b9532ffac681f513e196fa425e | |
parent | 602064955c313533975af034a89300b2dd7b8429 (diff) |
Making the String class a bit more tolerent of NULL strings.
-rw-r--r-- | includes/BString.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/includes/BString.h b/includes/BString.h index 794126f..89f1d9f 100644 --- a/includes/BString.h +++ b/includes/BString.h @@ -14,8 +14,8 @@ namespace Balau { class String : private std::string { public: String() : std::string() { } - String(const char * str) : std::string(str) { } - String(const char * str, size_t n) : std::string(str, n) { } + String(const char * str) : std::string(str ? str : "") { } + String(const char * str, size_t n) : std::string(str ? str : "", str ? n : 0) { } String(char c) { set("%c", c); } String(int32_t i) { set("%i", i); } String(uint32_t i) { set("%u", i); } |