* Durk Talsma -- Saturday 13 October 2007:
> Well, since I got exactly zero responses to my question, I assume
> that nobody objected. I committed a first stab of replacements in
> SimGear (plib branch only; will do SimGear / OSG later). 

Yeah, that's how one sneaks in controversial code! Just kidding. :-)

Some of the uses of sprintf() are really pretty safe, but on the
other hand, snprintf() is just better and not slower, so ...

But there's one thing: one of my IMHO correct uses of snprintf()
was changed by someone to add a \0 byte at the last position of
the possible maximum length, which I found a bit annoying.
To my knowledge this is only needed for strncpy()/strncat(), but
not for snprintf(). The manpage seems a bit unclear about it,
but the code example is very clear.

m.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to