]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Update.
authorUlrich Drepper <drepper@redhat.com>
Thu, 30 Aug 2001 23:22:02 +0000 (23:22 +0000)
committerUlrich Drepper <drepper@redhat.com>
Thu, 30 Aug 2001 23:22:02 +0000 (23:22 +0000)
2001-08-30  Ulrich Drepper  <drepper@redhat.com>

* string/argz-stringify.c (__argz_stringify): Use __strnlen
instead of strnlen.
* include/string.h (strndupa): Redefine here to use __strnlen
instead of strnlen.
* string/strndup.c (__strndup): Use __strnlen not strnlen.

* misc/syslog.c (vsyslog): Fix typo in last change (connect ->
connected).

ChangeLog
include/string.h
misc/syslog.c
string/argz-stringify.c
string/strndup.c

index d8a44e959e2813e02d1fa475092ca9d7acd27d55..2e206aba5584d8460015daab3099f620b88bfc24 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2001-08-30  Ulrich Drepper  <drepper@redhat.com>
+
+       * string/argz-stringify.c (__argz_stringify): Use __strnlen
+       instead of strnlen.
+       * include/string.h (strndupa): Redefine here to use __strnlen
+       instead of strnlen.
+       * string/strndup.c (__strndup): Use __strnlen not strnlen.
+
+       * misc/syslog.c (vsyslog): Fix typo in last change (connect ->
+       connected).
+
 2001-08-30  Jakub Jelinek  <jakub@redhat.com>
 
        * sysdeps/alpha/dl-machine.h (elf_machine_rela): Don't handle
index 7d268ecfb1732fab650a608c35390eb6902e31e6..8dda2f1b7e3267fa0df3d1c2906e8fb70cc9333f 100644 (file)
@@ -47,4 +47,16 @@ extern char *__strerror_r (int __errnum, char *__buf, size_t __buflen);
 /* Now the real definitions.  We do this here since some of the functions
    above are defined as macros in the headers.  */
 #include <string/string.h>
+
+/* Alternative version which doesn't pollute glibc's namespace.  */
+#undef strndupa
+#define strndupa(s, n)                                                       \
+  (__extension__                                                             \
+    ({                                                                       \
+      __const char *__old = (s);                                             \
+      size_t __len = __strnlen (__old, (n));                                 \
+      char *__new = (char *) __builtin_alloca (__len + 1);                   \
+      __new[__len] = '\0';                                                   \
+      (char *) memcpy (__new, __old, __len);                                 \
+    }))
 #endif
index 58f81996aa5aaa28d926fa7f2ab70b14a8219531..a27eb2ab92d4c02b2968ea66c8c90639497134fd 100644 (file)
@@ -247,7 +247,7 @@ vsyslog(pri, fmt, ap)
                openlog_internal(LogTag, LogStat | LOG_NDELAY, 0);
              }
 
-           if (!connect || __send(LogFile, buf, bufsize, 0) < 0)
+           if (!connected || __send(LogFile, buf, bufsize, 0) < 0)
              {
                closelog_internal ();   /* attempt re-open next time */
                /*
index 364555fa8d53d71e2c69fde0b32d4752484e75a6..9e1c0c7da603960bbe7da8c9febcef64587da88d 100644 (file)
@@ -1,5 +1,5 @@
 /* Routines for dealing with '\0' separated arg vectors.
-   Copyright (C) 1995,96,97,2000 Free Software Foundation, Inc.
+   Copyright (C) 1995,96,97,2000,2001 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Written by Miles Bader <miles@gnu.org>
 
@@ -29,7 +29,7 @@ __argz_stringify (char *argz, size_t len, int sep)
   if (len > 0)
     while (1)
       {
-       size_t part_len = strnlen (argz, len);
+       size_t part_len = __strnlen (argz, len);
        argz += part_len;
        len -= part_len;
        if (len-- <= 1)         /* includes final '\0' we want to stop at */
index 0bb60802629d8c7fe4d23c27fafbebd77cb70f68..98f497c7ed1099c7567481b6d21c6a29083f8bdf 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997, 1998, 2001 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -42,8 +42,8 @@ __strndup (s, n)
      const char *s;
      size_t n;
 {
-  size_t len = strnlen (s, n);
-  char *new = malloc (len + 1);
+  size_t len = __strnlen (s, n);
+  char *new = (char *) malloc (len + 1);
 
   if (new == NULL)
     return NULL;