g_*printf() (Was: gtk+-1.1.6 report)



On Wed, 9 Dec 1998, Jeff Garzik wrote:

> And g_snprintf, cuz it's always available and doesn't hurt to be safe.  :)
> Even malloc'd strings can overflow sometimes, given the "right" input.
I would like to suggest

   gchar *g_printf_new(gchar const *fmt, ...)

which returns a pointer to a string with apropriate length.
In my humble opinion this is a very often needed thing.

Remark: While looking through the glib sources to know, what the suggested
        functions where good for,  I found a lot of useful stuff which I
        ignored in former times.  I was a fool when I didn't checked glib
        before doing things myself...

Kind regards

      Andreas.



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