Re: sprintf and clists



Hi,

Sean Holt <mordist cox net> writes:

> gchar buffer[1024];
> 
> sprintf(buffer, "%d", some_dumb_int);
> cclist[0] = strdup(buffer);

or in one line w/o the risk of buffer overflows:

cclist[0] = g_strdup_printf ("%d", some_dumb_int);


Salut, Sven



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