Return -1/EINVAL when the buffer is too small.
[gnulib.git] / lib / canon-host.c
index 74c36f6..b0c2f44 100644 (file)
@@ -1,6 +1,6 @@
 /* Host name canonicalization
 
-   Copyright (C) 1995, 1999, 2000 Free Software Foundation, Inc.
+   Copyright (C) 1995, 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
 
    Written by Miles Bader <miles@gnu.ai.mit.edu>
 
 #ifdef HAVE_UNISTD_H
 # include <unistd.h>
 #endif
-#ifdef HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
-#ifdef HAVE_STRING_H
-# include <string.h>
-#endif
+#include <stdlib.h>
+#include <string.h>
 #ifdef HAVE_NETDB_H
 # include <netdb.h>
 #endif
 # include <arpa/inet.h>
 #endif
 
-#ifndef strdup
-char *strdup ();
-#endif
-
 /* Returns the canonical hostname associated with HOST (allocated in a static
    buffer), or 0 if it can't be determined.  */
 char *