Ethereal development <ethereal-dev@xxxxxxxxxxxx> schrieb am 20.10.05 18:38:58:
>
> /* RANT on */
> I think I missed the discussion where replacing strcpy with g_sprintf
> was considered a good idea.
> /* RANT off */
>
> Can someone explain why it's better to call a function which does
> - varargs
> - parses a string for formatting chars
> - calls strncpy!
> - calls strlen!
> is much better than a simple copy.
>
Where do you read about g_sprintf?!?
It's g_snprintf which is a lot more secure, as it checks if the target area is large enough to hold the resulting string.
A *common* mistake by using strcpy is to unintentionally copy a large source string into a destination area too small to hold it.
Regards, ULFL
__________________________________________________________________________
Erweitern Sie FreeMail zu einem noch leistungsstarkeren E-Mail-Postfach!
Mehr Infos unter http://freemail.web.de/home/landingpad/?mc=021131