The second parameter of strchr() is an integer, not a pointer.

So use '\0' instead of NULL.
This commit is contained in:
scw 2003-04-29 14:56:05 +00:00
parent 1fe87ac688
commit c7dadf502a
1 changed files with 5 additions and 5 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: getnetconfig.c,v 1.10 2003/01/18 11:29:04 thorpej Exp $ */
/* $NetBSD: getnetconfig.c,v 1.11 2003/04/29 14:56:05 scw Exp $ */
/*
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
@ -674,11 +674,11 @@ static struct netconfig *
*/
*p = *ncp;
p->nc_netid = (char *)strcpy(tmp,ncp->nc_netid);
tmp = strchr(tmp, NULL) + 1;
tmp = strchr(tmp, '\0') + 1;
p->nc_protofmly = (char *)strcpy(tmp,ncp->nc_protofmly);
tmp = strchr(tmp, NULL) + 1;
tmp = strchr(tmp, '\0') + 1;
p->nc_proto = (char *)strcpy(tmp,ncp->nc_proto);
tmp = strchr(tmp, NULL) + 1;
tmp = strchr(tmp, '\0') + 1;
p->nc_device = (char *)strcpy(tmp,ncp->nc_device);
p->nc_lookups = (char **)
malloc((size_t)(p->nc_nlookups+1) * sizeof(char *));
@ -687,7 +687,7 @@ static struct netconfig *
return(NULL);
}
for (i=0; i < p->nc_nlookups; i++) {
tmp = strchr(tmp, NULL) + 1;
tmp = strchr(tmp, '\0') + 1;
p->nc_lookups[i] = (char *)strcpy(tmp,ncp->nc_lookups[i]);
}
return(p);