libarchive: open_zipped() does not need to check extensions for e.g. gzip
[oweals/busybox.git] / libbb / safe_gethostname.c
index 1290f4ca719fc7016f433705e0ad880de8f15739..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;
 
@@ -45,9 +45,8 @@ char *safe_gethostname(void)
         * name and an 8-byte nodename), but this is true on Linux. The same holds
         * for setdomainname(2) and the domainname field.
         */
-       
+
        /* 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));
 }