Re: [gtk-list] gtkwidget + sprintf = bug ??



ryo writes:
>I have a problem when combining sprintf and 6 declarations of widget
>pointers. Sounds strange but I can explain. Look at the function end of
>this mail: 
>
>[extra snipped]
>
>Hope someone will be abble to help. 

It looks like you declared str as a pointer:

char *str;

Then printed to it without allocating the space:

sprintf(str,"%d",i);

Either use:
char str[whatever_size_you_need];
or malloc the space first.

John
--
John Ellis <gqview@geocities.com>
http://www.geocities.com/SiliconValley/Haven/5235/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]