[openbeos] Re: BString

  • From: "Earl Colby Pottinger" <earlcp@xxxxxxxxxxx>
  • To: openbeos@xxxxxxxxxxxxx
  • Date: Sun, 11 Nov 2001 18:48:25 EST


>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: