On 11/11/2009 12:58 AM, Roland Plüss wrote:
char buffer[ 50 ];
sprintf( ( char* )&buffer, "(%f,%f,%f,%f)", csobject.color.r,
csobject.color.g, csobject.color.b, csobject.color.a );
return gst_string_to_oop( buffer );
Returns garbage in smalltalk ( function returns OOP by the way and is
mapped with #smalltalk as return value ). As I get from the
documentation this function only "maps" the string and does not make a
copy.
No, that's not true. I think you are overrunning the buffer (besides,
(char*)&buffer is simply "buffer"). Try asprintf, like
char *buffer;
asprintf (&buffer, ...);
OOP stringOOP = gst_string_to_oop (buffer);
free (buffer);
return stringOOP;
Paolo
_______________________________________________
help-smalltalk mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-smalltalk