From ec2a031a6787f88bc01fa20d8162abfb844b2c3d Mon Sep 17 00:00:00 2001 From: Simon Josefsson Date: Thu, 17 Jan 2008 11:07:41 +0100 Subject: [PATCH] Need string.h unconditionally, for strncpy or strcpy. --- ChangeLog | 6 ++++++ lib/gethostname.c | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 467fadb2e9..776e8ff219 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 de3d9a527f..169dd4ef3b 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. */ -- 2.30.2