From: Simon Josefsson Date: Thu, 17 Jan 2008 10:07:41 +0000 (+0100) Subject: Need string.h unconditionally, for strncpy or strcpy. X-Git-Tag: v0.1~7822 X-Git-Url: http://erislabs.org.uk/gitweb/?a=commitdiff_plain;h=ec2a031a6787f88bc01fa20d8162abfb844b2c3d;p=gnulib.git Need string.h unconditionally, for strncpy or strcpy. --- diff --git a/ChangeLog b/ChangeLog index 467fadb2e..776e8ff21 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-01-17 Simon Josefsson + + * lib/gethostname.c: Include string.h unconditionally, strncpy is + used by the UNAME case. Reported by Bruno Haible + . + 2008-01-17 Eric Blake Convert c-strcasestr to be more efficient. diff --git a/lib/gethostname.c b/lib/gethostname.c index de3d9a527..169dd4ef3 100644 --- a/lib/gethostname.c +++ b/lib/gethostname.c @@ -21,10 +21,10 @@ #ifdef HAVE_UNAME # include -#else -# include #endif +#include + /* 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. */