This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
[PATCH] Fixes for _CS_GNU_* handling in confstr()
- From: Alexandre Julliard <julliard at winehq dot com>
- To: libc-alpha at sources dot redhat dot com
- Date: 04 Mar 2003 18:43:02 -0800
- Subject: [PATCH] Fixes for _CS_GNU_* handling in confstr()
confstr() doesn't work quite right for the new _CS_GNU_*
constants. This should fix it.
2003-03-04 Alexandre Julliard <julliard at winehq dot com>
* posix/confstr.c (confstr): Fix returned string length for
_CS_GNU_LIBC_VERSION and _CS_GNU_LIBPTHREAD_VERSION. Add missing
break in the _CS_GNU_LIBC_VERSION case.
Index: posix/confstr.c
===================================================================
RCS file: /cvs/glibc/libc/posix/confstr.c,v
retrieving revision 1.14
diff -u -r1.14 confstr.c
--- posix/confstr.c 12 Feb 2003 22:25:40 -0000 1.14
+++ posix/confstr.c 5 Mar 2003 02:06:28 -0000
@@ -143,12 +143,13 @@
case _CS_GNU_LIBC_VERSION:
string = "glibc " VERSION;
- string_len = strlen (string);
+ string_len = strlen (string) + 1;
+ break;
case _CS_GNU_LIBPTHREAD_VERSION:
#ifdef LIBPTHREAD_VERSION
string = LIBPTHREAD_VERSION;
- string_len = strlen (string);
+ string_len = strlen (string) + 1;
break;
#else
/* No thread library. */
--
Alexandre Julliard
julliard at winehq dot com