1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-29 16:44:03 +00:00

Use NULL instead of 0 in _ht_getnetbyname(..)

- getnetent returns NULL on completion/error.
- .h_aliases is NULL terminated.

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
This commit is contained in:
Enji Cooper 2016-06-08 23:23:19 +00:00
parent 103dce1405
commit 140f884e31
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=301707

View File

@ -215,10 +215,10 @@ _ht_getnetbyname(void *rval, void *cb_data, va_list ap)
}
_setnethtent(ned->stayopen, ned);
while ((error = getnetent_p(&ne, ned)) == 0) {
while ((error = getnetent_p(&ne, ned)) == NULL) {
if (strcasecmp(ne.n_name, name) == 0)
break;
for (cp = ne.n_aliases; *cp != 0; cp++)
for (cp = ne.n_aliases; *cp != NULL; cp++)
if (strcasecmp(*cp, name) == 0)
goto found;
}