Re: more on g_strconcat problem



Carl B. Constantine wrote:

sql = g_strconcat("insert into customers (id_req) values('", toggleTest, "')",0L);
g_print("First sql: %s\n",sql);

This code prints the following when the checkbox is unchecked:

insert into customers (id_req) values('

so it doesn't even complete the string. That same code crashes with a
segfault 11 if I check the checkbox in the dialog.

This makes absolutely NO sense what so ever!


Well, judging from the working part of your example, your toggleTest variable is not a string, but an integer. g_strconcat() wants strings. If you use an int in place of a string a segfault makes a lot of sense!

--
Christer Palm




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