Hi,
"J. Ali Harlow" <[EMAIL PROTECTED]> writes:
> That should be blankrow = (char **) malloc(vpsql->cols * sizeof(*blankrow));
Or glib-ish:
blankrow = g_new ((gchar *), vpsql->cols);
But remember to use g_free() to free the memory g_new() allocates
for you.
> > for (ctr=0; ctr<vpsql->cols; ctr++)
> > {
> > (char *)blankrow[ctr] = (char *)malloc(2);
> > sprintf((char *)blankrow[ctr]," ");
>
> These two lines could be blankrow[ctr] = strdup("")
or:
for (ctr = 0; ctr < vpsql->cols; ctr++)
blankrow[ctr] = "";
since it shouldn't hurt to use the same constant empty string
everywhere. In that case you should of course not try to free
it later.
Salut, Sven
_______________________________________________
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list