more on g_strconcat problem



Ok, I've definately nailed the problem down to an issue with the check
button in my data entry box. But it still doesn't make sense. consider
the following code:

idRequired = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(lookup_widget(customers, "cust_id_req")));
  g_print("ID Required status: %d\n", idRequired);
  
  toggleTest = (gint)idRequired;
  g_print("ID Required status: %d\n", toggleTest);

the above code prints 0 if the checkbox is unchecked and 1 if it is
checked. 

With that in mind, consider the following additional code:

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!

Please help, this is driving me NUTSO!

-- 
 .''`.      Carl B. Constantine
: :' :     duckwing duckwing ca
`. `'    GnuPG: 135F FC30 7A02 B0EB 61DB  34E3 3AF1 DC6C 9F7A 3FF8
  `-  Debian GNU/Linux -- The power of freedom
  "Claiming that your operating system is the best in the world because more
  people use it is like saying McDonalds makes the best food in the world."



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