Mail Archives: djgpp-workers/2002/06/09/15:51:56
Hello.
Here's a patch to avoid a call to snprintf to truncate a string in
confstr. OK to commit?
Thanks, bye, Rich =]
Index: src/libc/posix/unistd/confstr.c
===================================================================
RCS file: /cvs/djgpp/djgpp/src/libc/posix/unistd/confstr.c,v
retrieving revision 1.3
diff -p -u -3 -r1.3 confstr.c
--- src/libc/posix/unistd/confstr.c 2001/06/19 17:04:19 1.3
+++ src/libc/posix/unistd/confstr.c 2002/06/09 19:49:16
@@ -43,7 +43,9 @@ confstr(int name, char *buf, size_t len)
case _CS_POSIX_V6_ILP32_OFF32_LDFLAGS:
case _CS_POSIX_V6_ILP32_OFF32_LIBS:
{
- out_len = snprintf(buf, len, "");
+ if (buf && (len > 0))
+ buf[0] = 0;
+ /* confstr includes the null terminator in its return value. */
++out_len;
break;
}
- Raw text -