]> git.ipfire.org Git - thirdparty/mtr.git/commitdiff
init structures correctly wired up
authorAaron Lipinski <aaron.lipinski@roboticsplus.co.nz>
Tue, 6 Apr 2021 01:23:14 +0000 (13:23 +1200)
committerAaron Lipinski <aaron.lipinski@roboticsplus.co.nz>
Thu, 8 Apr 2021 20:36:25 +0000 (08:36 +1200)
ui/mtr.c

index 91773f4d729b52beee675da891f405cb52ac10dd..ef567f6730de6d52d7f52d43ade750d38b1afaf4 100644 (file)
--- a/ui/mtr.c
+++ b/ui/mtr.c
@@ -766,9 +766,9 @@ int main(
     int argc,
     char **argv)
 {
-    struct hostent *host = NULL;
-    struct hostent trhost;
     char *alptr[2];
+    struct hostent trhost;
+    struct hostent *host = &trhost;
     names_t *names_head = NULL;
     names_t *names_walk;
 
@@ -837,7 +837,6 @@ int main(
                      sizeof(ctl.LocalHostname));
         }
 
-        host = &trhost;
         if (get_hostent_from_name(&ctl, host, ctl.Hostname, alptr) != 0) {
             if (ctl.Interactive)
                 exit(EXIT_FAILURE);