From: Ulrich Drepper Date: Tue, 21 Jul 1998 12:17:51 +0000 (+0000) Subject: Return ENAMETOOLONG if buffer is too small. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cb5993c2e67aa267643fc3b352fc7eb1f52836f4;p=thirdparty%2Fglibc.git Return ENAMETOOLONG if buffer is too small. --- diff --git a/sysdeps/unix/sysv/linux/gethostname.c b/sysdeps/unix/sysv/linux/gethostname.c index 8a01fff073f..a7c707b0991 100644 --- a/sysdeps/unix/sysv/linux/gethostname.c +++ b/sysdeps/unix/sysv/linux/gethostname.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1992, 1995, 1996 Free Software Foundation, Inc. +/* Copyright (C) 1992, 1995, 1996, 1998 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -42,7 +42,7 @@ __gethostname (name, len) if (strlen (buf.nodename) + 1 > len) { - __set_errno (EINVAL); + __set_errno (ENAMETOOLONG); return -1; }