summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPixel <pixel@nobis-crew.org>2011-11-15 20:57:27 -0800
committerPixel <pixel@nobis-crew.org>2011-11-15 20:57:27 -0800
commite2f4752ab5f0e6dba96df8d7c35e102ded57c3f9 (patch)
tree073fe4bed08bb6b9532ffac681f513e196fa425e
parent602064955c313533975af034a89300b2dd7b8429 (diff)
Making the String class a bit more tolerent of NULL strings.
-rw-r--r--includes/BString.h4
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); }