]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
Merge shiny.ad.hartbrothers.com:C:/ntp/ntp-stable-1978
authorDave Hart <hart@ntp.org>
Wed, 27 Jul 2011 22:13:25 +0000 (22:13 +0000)
committerDave Hart <hart@ntp.org>
Wed, 27 Jul 2011 22:13:25 +0000 (22:13 +0000)
into  shiny.ad.hartbrothers.com:C:/ntp/ntp-dev-1976

bk: 4e308d85XEbeKJvmSSXzZEar2I2rbg

1  2 
ChangeLog
ntpdc/ntpdc.c
ntpq/ntpq.c

diff --cc ChangeLog
Simple merge
diff --cc ntpdc/ntpdc.c
index cfdda72d3bcc67b3573320849479650cf70095c5,bffaf09a02c1f4956dca93eb73ebd5cd5e94ef44..f40b40af9d236524fabebb9d90c7613db94d07c3
@@@ -1447,16 -1504,15 +1445,15 @@@ getnetnum
                                getnameinfo(&num->sa, SOCKLEN(num),
                                            fullhost, LENHOSTNAME, NULL,
                                            0, 0);
 -                      }
                }
                return 1;
-       } else {
-               (void) fprintf(stderr, "***Can't find host %s\n", hname);
-               return 0;
        }
-       /*NOTREACHED*/
+       fprintf(stderr, "***Can't find host %s\n", hname);
+       return 0;
  }
  
 +
  /*
   * nntohost - convert network number to host name.  This routine enforces
   *           the showhostnames setting.
diff --cc ntpq/ntpq.c
index c350f3a1dc8cfbc0b3a81dcc28ea65e5362b1f8f,9ba3925dae1af7cf734f77889092a8b4c9a472cf..0375d9e21a1e94cd26822ad5766c4419afe4325f
@@@ -1702,16 -1847,17 +1702,16 @@@ getnetnum
        if (decodenetnum(hname, num)) {
                if (fullhost != NULL)
                        getnameinfo(&num->sa, SOCKLEN(num), fullhost,
-                                   LENHOSTNAME, NULL, 0, 0); 
+                                   LENHOSTNAME, NULL, 0, 0);
                return 1;
        } else if (getaddrinfo(hname, "ntp", &hints, &ai) == 0) {
 -              NTP_INSIST(sizeof(*num) >= ai->ai_addrlen);
 +              INSIST(sizeof(*num) >= ai->ai_addrlen);
                memcpy(num, ai->ai_addr, ai->ai_addrlen);
                if (fullhost != NULL) {
 -                      if (ai->ai_canonname != NULL) {
 -                              strncpy(fullhost, ai->ai_canonname,
 +                      if (ai->ai_canonname != NULL)
 +                              strlcpy(fullhost, ai->ai_canonname,
                                        LENHOSTNAME);
 -                              fullhost[LENHOSTNAME - 1] = '\0';
 -                      } else {
 +                      else
                                getnameinfo(&num->sa, SOCKLEN(num),
                                            fullhost, LENHOSTNAME, NULL,
                                            0, 0);