On Fri, Apr 1, 2011 at 5:43 AM, Andrew Beekhof <andrew(a)beekhof.net> wrote:
On Mon, Mar 28, 2011 at 6:45 AM, Russell Bryant
<russell(a)russellbryant.net> wrote:
> I first started looking at this particular function because of a
> warning emitted by valgrind:
>
> ==18466== Conditional jump or move depends on uninitialised value(s)
> ==18466== at 0x3186A4919E: vfprintf (in /lib64/libc-2.13.90.so)
> ==18466== by 0x3186A71451: vsnprintf (in /lib64/libc-2.13.90.so)
> ==18466== by 0x3186A51FE1: snprintf (in /lib64/libc-2.13.90.so)
> ==18466== by 0x4C20697: host_os_get_uuid (in /usr/lib64/libmhost.so.0.0.1)
> ==18466== by 0x40CC9D: HostAgent::setup(qpid::management::ManagementAgent*) (in
/usr/sbin/matahari-hostd)
> ==18466== by 0x43A9AA: MatahariAgent::init(int, char**, char const*) (in
/usr/sbin/matahari-hostd)
> ==18466== by 0x40BB9E: main (in /usr/sbin/matahari-hostd)
>
> The changes are:
>
> 1) Instead of open coding a loop looking for an end of line or
> the end of the buffer, use strchrnul().
IIRC there was a reason I stopped using that - perhaps it was windows
compatibility but that code is conditional on linux... anyway, ack.
Yeah ... it looks like it's a GNU extension. If we need it in
platform neutral code we can add a trivial custom one that gets used
if the build system doesn't find a system provided one.
--
Russell Bryant