BMessage::AddString() no longer crashes when the string to add is NULL.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16410 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2006-02-15 17:15:49 +00:00
parent 4f92605003
commit 9bce8e570a
2 changed files with 2 additions and 2 deletions

View File

@ -1287,7 +1287,7 @@ DEFINE_LAZY_FIND_FUNCTION(const char* , String)
status_t
BMessage::AddString(const char* name, const char* string)
{
return AddData(name, B_STRING_TYPE, string, strlen(string) + 1);
return AddData(name, B_STRING_TYPE, string, string ? strlen(string) + 1 : 0);
}

View File

@ -2036,7 +2036,7 @@ DEFINE_LAZY_FIND_FUNCTION(double, Double, 0);
status_t
BMessage::AddString(const char *name, const char *string)
{
return AddData(name, B_STRING_TYPE, string, strlen(string) + 1, false);
return AddData(name, B_STRING_TYPE, string, string ? strlen(string) + 1 : 0, false);
}