bk: 45fc4d68EPTSZNYHiGGCxqSI58JaUg
* [Bug 795] Moved declaration of variable to top of function.
-* [Bug 798] ntpq [p typo crashes ntpq.
+* [Bug 798] ntpq [p typo crashes ntpq/ntpdc.
* [Bug 786] Fix refclock_bancomm.c on Solaris.
* [Bug 789] Fix multicast client crypto authentication.
* [Bug 774] parsesolaris.c does not compile under the new Solaris.
if (*cp == '[') {
cp++;
- for(i = 0; *cp != ']'; cp++, i++)
- name[i] = *cp;
- name[i] = '\0';
- hname = name;
+ for (i = 0; *cp && *cp != ']'; cp++, i++)
+ name[i] = *cp;
+ if (*cp == ']') {
+ name[i] = '\0';
+ hname = name;
+ } else {
+ return 0;
+ }
}
/*