X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fgethostname.c;h=eedc40ec4fe563123c6510af3991195265ca5ad2;hb=0d0706a5f5e05d18ab61e7f19ca407452db68a31;hp=fe78dbb4a4c28c02d69d7dc54d947454e5d19c45;hpb=43e78b970f396160a887c9da94531569faeda8a0;p=gnulib.git diff --git a/lib/gethostname.c b/lib/gethostname.c index fe78dbb4a..eedc40ec4 100644 --- a/lib/gethostname.c +++ b/lib/gethostname.c @@ -1,5 +1,6 @@ /* gethostname emulation for SysV and POSIX.1. - Copyright (C) 1992 Free Software Foundation, Inc. + + Copyright (C) 1992, 2003, 2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -12,23 +13,25 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + along with this program; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* David MacKenzie */ +#include + #ifdef HAVE_UNAME -#include +# include #endif /* 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. */ +#include + int -gethostname (name, len) - char *name; - int len; +gethostname (char *name, size_t len) { #ifdef HAVE_UNAME struct utsname uts;