Need string.h unconditionally, for strncpy or strcpy.
authorSimon Josefsson <simon@josefsson.org>
Thu, 17 Jan 2008 10:07:41 +0000 (11:07 +0100)
committerSimon Josefsson <simon@josefsson.org>
Thu, 17 Jan 2008 10:07:41 +0000 (11:07 +0100)
ChangeLog
lib/gethostname.c

index 467fadb..776e8ff 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-01-17  Simon Josefsson  <simon@josefsson.org>
+
+       * lib/gethostname.c: Include string.h unconditionally, strncpy is
+       used by the UNAME case.  Reported by Bruno Haible
+       <bruno@clisp.org>.
+
 2008-01-17  Eric Blake  <ebb9@byu.net>
 
        Convert c-strcasestr to be more efficient.
index de3d9a5..169dd4e 100644 (file)
 
 #ifdef HAVE_UNAME
 # include <sys/utsname.h>
-#else
-# include <string.h>
 #endif
 
+#include <string.h>
+
 /* Put up to LEN chars of the host name into NAME.
    Null terminate it if the name is shorter than LEN.
    Return 0 if ok, -1 if error.  */