libarchive: open_zipped() does not need to check extensions for e.g. gzip
[oweals/busybox.git] / libbb / safe_gethostname.c
index 3b24edba574b9e78cbbcc72d17287cde5c7df2f2..cac99ae03902d6e1313b48b954a6a64fb2ff0078 100644 (file)
@@ -4,7 +4,7 @@
  *
  * Copyright (C) 2008 Tito Ragusa <farmatito@tiscali.it>
  *
- * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
+ * Licensed under GPLv2 or later, see file LICENSE in this source tree.
  */
 
 /*
@@ -33,7 +33,7 @@
  * This is an illegal first character for a hostname.
  * The returned malloced string must be freed by the caller.
  */
-char *safe_gethostname(void)
+char* FAST_FUNC safe_gethostname(void)
 {
        struct utsname uts;
 
@@ -48,6 +48,5 @@ char *safe_gethostname(void)
 
        /* Uname can fail only if you pass a bad pointer to it. */
        uname(&uts);
-
-       return xstrndup(!*(uts.nodename) ? "?" : uts.nodename, sizeof(uts.nodename));
+       return xstrndup(!uts.nodename[0] ? "?" : uts.nodename, sizeof(uts.nodename));
 }