[Nagios-devel] common/snprintf.c doesn't handle floating point (w/fix)

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Guest

[Nagios-devel] common/snprintf.c doesn't handle floating point (w/fix)

Post by Guest »

Nagios 1.0b5 was seg-faulting on my Solaris 2.5.1 system, and I tracked it
down to common/snprintf.c not handling floating point. It was a call
from xsddefault_update_host_status() that first required floating
point. common/snprintf.c deals with a "%f" by writing "???????",
but ignoring the argument on the stack, and that's not sufficient.

The page
http://www.ijs.si/software/snprintf/
has a lot of information on snprintf(). The version there also
does not do floating point, but the page includes a reference
to the samba version at
http://samba.org/cgi-bin/cvsweb/samba/s ... snprintf.c
which has the same origin (Patrick Powell)
as the version included with nagios, but the samba version
has been enhanced for floating point.

I replaced the nagios snprintf.c with the samba version, and things
seem to be working as expected. So I'm suggesting that as a likely
fix.

Cheers! Thanks!

John
jsellens@generalconcepts.com





This post was automatically imported from historical nagios-devel mailing list archives
Original poster: jsellens@generalconcepts.com
Locked