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:
parent
4f92605003
commit
9bce8e570a
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user