[oi-dev] What changed between glib versions?

Gary Mills gary_mills at fastmail.fm
Sat Apr 9 14:08:32 UTC 2022


On Fri, Apr 08, 2022 at 06:41:24PM -0500, Gary Mills wrote:
> 
> I can confirm that the line ending is "\n\0", something that is not
> documented as correct.  That's the same hal bug that I suggested was
> possible.  I also suggested an easy solution.

My suggestion is part of:

    https://www.illumos.org/issues/14227

It only would take a simple patch to hald to eliminate the trailing
NUL byte.  The first change is just before the write() to the pipe by
reducing the byte count by one.  That's the same thing that strlen()
would return.  The second change is just before the sscanf() that
parses the output from the pipe.  It restores the terminating NUL by
overwriting the last byte of the string, which will be the newline
byte.  As far as I can tell, the NUL byte is needed by sscanf().


-- 
-Gary Mills-		-refurb-		-Winnipeg, Manitoba, Canada-



More information about the oi-dev mailing list