Add a string regardless if a NULL pointer was passed. This fixes a fragility in the comm code, and People is now displayed correctly.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12951 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -24,6 +24,7 @@
|
|||||||
// Description: Class for low-overhead port-based messaging
|
// Description: Class for low-overhead port-based messaging
|
||||||
//
|
//
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <new>
|
#include <new>
|
||||||
@@ -263,10 +264,18 @@ status_t LinkMsgSender::Flush(bigtime_t timeout)
|
|||||||
status_t LinkMsgSender::AttachString(const char *string)
|
status_t LinkMsgSender::AttachString(const char *string)
|
||||||
{
|
{
|
||||||
status_t err;
|
status_t err;
|
||||||
if (string == NULL)
|
if (string == NULL) {
|
||||||
return B_BAD_VALUE;
|
// TODO: This whole comm thing is so broken.... if we're for some
|
||||||
|
// reason attaching a NULL string, and don't do it, the receiving
|
||||||
|
// party will still try to read a string!! The whole communication
|
||||||
|
// will be messed up if the stream does not contain what the client
|
||||||
|
// things it contains. This is a quick fix (but just for this
|
||||||
|
// particular problem). -Stephan
|
||||||
|
// return B_BAD_VALUE;
|
||||||
|
string = "";
|
||||||
|
}
|
||||||
|
|
||||||
int32 len = strlen(string)+1;
|
int32 len = strlen(string) + 1;
|
||||||
err = Attach<int32>(len);
|
err = Attach<int32>(len);
|
||||||
if (err < B_OK)
|
if (err < B_OK)
|
||||||
return err;
|
return err;
|
||||||
|
|||||||
Reference in New Issue
Block a user