Date: Sun, 09 Jun 2002 20:58:00 +0100 From: "Richard Dawe" Sender: rich AT phekda DOT freeserve DOT co DOT uk To: djgpp-workers AT delorie DOT com X-Mailer: Emacs 21.3.50 (via feedmail 8.3.emacs20_6 I) and Blat ver 1.8.6 Subject: confstr.c and gcc 3.1 Message-Id: Reply-To: djgpp-workers AT delorie DOT com 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; }