Re: [Nagios-devel] change multiple if statements by isspace() +

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

Re: [Nagios-devel] change multiple if statements by isspace() +

Post by Guest »

On 11/27/2012 02:51 PM, Ricardo Jose Maraschini wrote:
> Hya,
>
> calloc already sets memory to 0 and i think that if we already have
> a function to verify if a given char is an space, we should use it.
>
> ok? comments?
>

"isspace()" takes locale into account, but nagiostats will only ever
read 7-bit ascii as syntactically important, so that part of the patch
is wrong. "isspace()" also takes form feeds and vertical tabs, which
the current code doesn't.

The memset() part of the patch is technically correct. The gains of
removing it is about one nanosecond per program start, but since
it's an easy fix I'll apply it anyway.

--
Andreas Ericsson [email protected]
OP5 AB www.op5.se
Tel: +46 8-230225 Fax: +46 8-230231

Considering the successes of the wars on alcohol, poverty, drugs and
terror, I think we should give some serious thought to declaring war
on peace.





This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
Locked