[interfacekit] Re: Broken BMessage

BTW, the last time I looked, which was quite recently, I noticed two problems:

FindString() is supposed to return a pointer to a null terminated string that 
exists as long as
the field is still in the BMessage (other words probably a pointer to the 
actual field).

Currently it tries to copy is into a stack array without a null terminator and 
return a pointer to
it. The actual field itself is also stored as an unterminated char arrray, with 
the strlen() being
recorded. It should include a null-terminated and have the size of strlen()+1.

There are multiple implementations of ::Flatten() and ::Unflatten() both have 
the exact same
prototype.

Cheers,
Pahtz.

--- Ingo Weinhold <bonefish@xxxxxxxxxxxxxxx> wrote:
> void
> main()
> {
>       IsAppPreRegistered();
>       BMessage testTypes1;
>       testTypes1.AddString("types", 
> "application/x-vnd.obos.app-file-info-test1");
>       testTypes1.AddString("types", 
> "application/x-vnd.obos.app-file-info-test2");
>       const char *type;
>       testTypes1.FindString("types", 2, &type);
> }
> 
> 



                
_______________________________
Do you Yahoo!?
Win 1 of 4,000 free domain names from Yahoo! Enter now.
http://promotions.yahoo.com/goldrush

Other related posts: