From 534bebec39c34e7c1ea20477b5abeaa9575a6269 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Sat, 9 Jan 2010 23:06:30 +0000 Subject: [PATCH] When BString assignment operator is called with a NULL argument we should use an empty string instead. I checked this against Dano. This fixed #4713 git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34983 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/support/String.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/kits/support/String.cpp b/src/kits/support/String.cpp index cacfb218d8..72d8a57aac 100644 --- a/src/kits/support/String.cpp +++ b/src/kits/support/String.cpp @@ -297,7 +297,9 @@ BString::operator=(const BString& string) BString& BString::operator=(const char* string) { - if (string && string != String()) + if (!string) + string = ""; + if (string != String()) SetTo(string, strlen(string)); return *this; }