Re: sprintf and clists
- From: Marco Lettere <lettere di unipi it>
- To: Sean Holt <mordist cox net>
- Cc: Carlos <ztoonifik netcourrier com>, <gtk-list gnome org>
- Subject: Re: sprintf and clists
- Date: Tue, 25 Jun 2002 09:32:06 +0200 (CEST)
On Tue, 25 Jun 2002, Sean Holt wrote:
> gchar buffer[1024];
> static gchar *cclist[1];
>
> sprintf(buffer, "%d", some_dumb_int);
> cclist[0] = strdup(buffer);
> gtk_clist_append(GTK_CLIST(clist1), cclist);
>
> This is assuming you have a 1 column clist.
>
check out if the string is '\0' terminated. best initialize it after the
declaration with memset(buffer,'\0',1024);
BTW wouldn't it be enough to use a buffer of size "sizeof(int)" ?
M.
____ _____
| _ \ ___ ___ _ __| ____|
| | | |/ __/ _ \| '__| _|
| |_| | (_| (_) | | | |___
|____/ \___\___/|_| |_____|
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]