RE: [gtk-list] gtkwidget + sprintf = bug ??
- From: "O'CONNOR, Steve" <SOCONNOR baea com au>
- To: "'gtk-list redhat com'" <gtk-list redhat com>
- Subject: RE: [gtk-list] gtkwidget + sprintf = bug ??
- Date: Tue, 2 Jun 1998 13:15:54 +0930
Just cleaning out my mailbox, I found this ...
Hope you have fixed it by now !
>>
> char *str;
> int i;
>
.. blah, blah, blah
> sprintf(str,"%d",i);
.. blah blah blah
>>
The 6 GtkWidget* declarations thing was a red herriing, as these
declarations go on the stack, and merely change the point in time at
which this program WILL crash.
As far as I can see, 'str' is un-initialized by the time that
you try to sprintf into it, so that is the sole cause of your problem.
try declaring it as
static char str[64]; or however big you need it to be.
Making it static will prevent it from flogging the stack too heavily
whenever this function is called.
ta,
Steve O'Connor
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]