> > > If you must code in C, at least use the safe routines in glib
> > > (for example g_strdup_sprintf) rather then using unsafe
> > > functions such as sprintf.
> >
> > This might be not feasible if you need to write portable code
> > (nor will be snprintf(), which is non-standard, IIRC). You need
> > to get into the habit of putting checks in your code to prevent
> > buffer overflows.
>
>To reiterate my point: use glib instead of libc. Glib is *very*
>portable.


Speaking of snprintf (and strncpy and strncat for that matter), it seems 
that these functions have two major prolbems:

1. Big time penalty, and
2. Weired behaviour. That is why, as far as string functions
   manipulations go, it is recommended to use the functions that are
   used in OpenBSD, namely strlcpy(3) and strlcat(3).

Read more about it at the "Secure-Programming" HOWTO.

________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com


=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to