24 Jun 2012 23:09
ttyname_r on OSF/1
Bruno Haible <bruno <at> clisp.org>
2012-06-24 21:09:29 GMT
2012-06-24 21:09:29 GMT
On OSF/1, I'm seeing this test failure in an *interactive* "make check" of
a ptsname_r testdir:
test-ptsname_r.c:193: assertion failed
FAIL: test-ptsname_r
It turns out the cause is a bug in gnulib's ttyname_r: It fails to add a
trailing NUL byte to the output string. This fixes it.
2012-06-24 Bruno Haible <bruno <at> clisp.org>
ttyname_r: Fix result on OSF/1, Solaris.
* lib/ttyname_r.c (ttyname_r): Produce a NUL-terminated result.
--- lib/ttyname_r.c.orig Sun Jun 24 22:37:31 2012
+++ lib/ttyname_r.c Sun Jun 24 22:33:15 2012
<at> <at> -45,7 +45,7 <at> <at>
return err;
if (buflen < sizeof (largerbuf))
{
- size_t namelen = strlen (largerbuf);
+ size_t namelen = strlen (largerbuf) + 1;
if (namelen > buflen)
return ERANGE;
memcpy (buf, largerbuf, namelen);
RSS Feed