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 467fadb2e9c6e65560d3a228c7c84ec2a41d2117..776e8ff2190997ddfe1d942d087653c29a56d530 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 de3d9a527f4be18ce2ac07f0f863c74b9c3d13f4..169dd4ef3b0e00afbd2536f05736552c5ca8ea67 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.  */