Overall the patch looks fine.  There are three small changes I'd like to
make (attached as a patch file):

1. Since uname sets errno, change the fputs to perror.

2. safe_strdup() checks for NULL params, so remove the redundant
NONULL().

3. buffer is allocated on the stack, and can't be NULL, so remove the NONULL.

If they look okay to you, I'll just test a bit more and push this out.

-- 
Kevin J. McCarthy
GPG Fingerprint: 8975 A9B3 3AA3 7910 385C  5308 ADEF 7684 8031 6BDA
http://www.8t8.us/configs/gpg-key-transition-statement.txt
# HG changeset patch
# User Kevin McCarthy <[email protected]>
# Date 1457396682 28800
#      Mon Mar 07 16:24:42 2016 -0800
# Node ID df9177c7328413d80c61ef562284761dc13e514d
# Parent  c88f97f88c90164744e886800922227e3225bb87
imported patch kjm-fixes

diff --git a/init.c b/init.c
--- a/init.c
+++ b/init.c
@@ -2962,37 +2962,37 @@
   /* 
    * The call to uname() shouldn't fail, but if it does, the system is horribly
    * broken, and the system's networking configuration is in an unreliable
    * state.  We should bail.
    */
   if ((uname (&utsname)) == -1)
   {
     mutt_endwin (NULL);
-    fputs (_("unable to determine nodename via uname()"), stderr);
+    perror (_("unable to determine nodename via uname()"));
     exit (1);
   }
 
   /* some systems report the FQDN instead of just the hostname */
   if ((p = strchr (utsname.nodename, '.')))
     Hostname = mutt_substrdup (utsname.nodename, p);
   else
-    Hostname = safe_strdup(NONULL(utsname.nodename));
+    Hostname = safe_strdup (utsname.nodename);
 
   /* now get FQDN.  Use configured domain first, DNS next, then uname */
   if (domain) 
   {
     /* we have a compile-time domain name, use that for Fqdn */
     Fqdn = safe_malloc (mutt_strlen (domain) + mutt_strlen (Hostname) + 2);
     sprintf (Fqdn, "%s.%s", NONULL(Hostname), domain); /* __SPRINTF_CHECKED__ 
*/
   }
   else if (!(getdnsdomainname (buffer, sizeof buffer)))
   {
     Fqdn = safe_malloc (mutt_strlen (buffer) + mutt_strlen (Hostname) + 2);
-    sprintf (Fqdn, "%s.%s", NONULL(Hostname), NONULL(buffer)); /* 
__SPRINTF_CHECKED__ */
+    sprintf (Fqdn, "%s.%s", NONULL(Hostname), buffer); /* __SPRINTF_CHECKED__ 
*/
   }
   else
     /* 
      * DNS failed, use the nodename.  Whether or not the nodename had a '.' in
      * it, we can use the nodename as the FQDN.  On hosts where DNS is not
      * being used, e.g. small network that relies on hosts files, a short host
      * name is all that is required for SMTP to work correctly.  It could be
      * wrong, but we've done the best we can, at this point the onus is on the

Attachment: signature.asc
Description: PGP signature

Reply via email to