ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Hi, I hope somebody can help me, my program crashes if I uncomment the line "gtk_label_set_text(label,buf);" from the "timer" function. Application works fine to me, I just want a very simple cronometer, and it works if I keep that line commented, the problem is that I can only show the cronometer to the console, and I want it in the GUI.
I don't know why the gtk_label_set_text function works in my function "arranca" but crashes in function "timer", any ideas?
1. Make "buf[8]" larger (maybe you're overwriting your buffer and corrupting adjacent memory).
2. Compile with "-g" and step through the code in under the debugger.
Verify that the hex address of "label" is the same in each of "timer()", "arranca()" and "main()".
1. Make "buf[8]" larger (maybe you're overwriting your buffer and corrupting adjacent memory).
And use something other than sprintf, which makes it very easy to make this kind of mistake. Use snprintf, or better yet, change the char arrar to a gchar array and use g-snprintf
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.