-/* $OpenBSD: getnetent.c,v 1.16 2015/01/16 18:18:58 millert Exp $ */
+/* $OpenBSD: getnetent.c,v 1.17 2015/01/16 18:20:14 millert Exp $ */
/*
* Copyright (c) 1983, 1993
* The Regents of the University of California. All rights reserved.
if ((cp = strchr(p, '#')) != NULL)
*cp = '\0';
net.n_name = p;
- if (strlen(net.n_name) >= HOST_NAME_MAX)
+ if (strlen(net.n_name) > HOST_NAME_MAX)
net.n_name[HOST_NAME_MAX] = '\0';
cp = strpbrk(p, " \t");
if (cp == NULL)
}
if (q < &net_aliases[MAXALIASES - 1]) {
*q++ = cp;
- if (strlen(cp) >= HOST_NAME_MAX)
+ if (strlen(cp) > HOST_NAME_MAX)
cp[HOST_NAME_MAX] = '\0';
}
cp = strpbrk(cp, " \t");