-/* $OpenBSD: sysconf.c,v 1.21 2015/01/16 16:48:51 deraadt Exp $ */
+/* $OpenBSD: sysconf.c,v 1.22 2015/01/16 18:18:58 millert Exp $ */
/*-
* Copyright (c) 1993
* The Regents of the University of California. All rights reserved.
/* Unsorted */
case _SC_HOST_NAME_MAX:
- return (HOST_NAME_MAX+1 - 1); /* does not include \0 */
+ return (HOST_NAME_MAX); /* does not include \0 */
case _SC_MONOTONIC_CLOCK:
return (_POSIX_MONOTONIC_CLOCK);
case _SC_2_PBS:
-/* $OpenBSD: getnetent.c,v 1.15 2015/01/16 16:48:51 deraadt Exp $ */
+/* $OpenBSD: getnetent.c,v 1.16 2015/01/16 18:18:58 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+1-1)
- net.n_name[HOST_NAME_MAX+1-1] = '\0';
+ if (strlen(net.n_name) >= HOST_NAME_MAX)
+ net.n_name[HOST_NAME_MAX] = '\0';
cp = strpbrk(p, " \t");
if (cp == NULL)
goto again;
}
if (q < &net_aliases[MAXALIASES - 1]) {
*q++ = cp;
- if (strlen(cp) >= HOST_NAME_MAX+1-1)
- cp[HOST_NAME_MAX+1-1] = '\0';
+ if (strlen(cp) >= HOST_NAME_MAX)
+ cp[HOST_NAME_MAX] = '\0';
}
cp = strpbrk(cp, " \t");
if (cp != NULL)
-/* $OpenBSD: res_comp.c,v 1.15 2015/01/16 16:48:51 deraadt Exp $ */
+/* $OpenBSD: res_comp.c,v 1.16 2015/01/16 18:18:58 millert Exp $ */
/*
* ++Copyright++ 1985, 1993
dn = exp_dn;
cp = comp_dn;
- if (length > HOST_NAME_MAX+1-1)
- length = HOST_NAME_MAX+1-1;
+ if (length > HOST_NAME_MAX)
+ length = HOST_NAME_MAX;
eom = exp_dn + length;
/*
* fetch next label in domain name