[openbeos] Re: BString

  • From: Keith Poole <keef@xxxxxxxxxxxxxxx>
  • To: openbeos@xxxxxxxxxxxxx
  • Date: Mon, 12 Nov 2001 21:57:02 +0000

Seems reasonable - mind you how should String() handle strings with 
embedded nulls - just return the first part - or something cleverer?


Earl Colby Pottinger wrote:

>>Just quickie, I am writing a version of BString, just to cut my teeth, 
>>any objections/suggestions?
>>       Keith
>Sorry I have not posted back earlier.  I believe that BStrings as it presently 
>exists in BeOS is broken.  The reason, it treats it's strings like 'C' strings 
>in some cases using a zero byte to make the end of the string and at other 
>times using the Length() function to tell it the string length to control 
>string functions.
>I believe that BStrings should always use the Length() function and thus allow 
>bytes containing zeros(0) to exist inside a string.
>Also note:  If you read the BeBook BString section that there is no mention 
>that BStrings are zero terminated, only that the String() function will return 
>a zero terminated string.
>           Earl Colby Pottinger
>PS.  I am working a small test program to show what I mean, I will post the 
>code as soon as possible.

Other related posts: