Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-1-5]: src/lib/libc/rpc Pull up rev. 1.2:
details: https://anonhg.NetBSD.org/src/rev/36f44fca8bdd
branches: netbsd-1-5
changeset: 488383:36f44fca8bdd
user: thorpej <thorpej%NetBSD.org@localhost>
date: Mon Jul 03 22:19:26 2000 +0000
description:
Pull up rev. 1.2:
PR/10499: IWAMOTO Toshihiro: getnetconfig uses strtok. Applied suggested patch
to use strtok_r
diffstat:
lib/libc/rpc/getnetconfig.c | 17 +++++++++--------
1 files changed, 9 insertions(+), 8 deletions(-)
diffs (61 lines):
diff -r 7a45ba47ae2d -r 36f44fca8bdd lib/libc/rpc/getnetconfig.c
--- a/lib/libc/rpc/getnetconfig.c Mon Jul 03 22:18:17 2000 +0000
+++ b/lib/libc/rpc/getnetconfig.c Mon Jul 03 22:19:26 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: getnetconfig.c,v 1.1 2000/06/02 23:11:11 fvdl Exp $ */
+/* $NetBSD: getnetconfig.c,v 1.1.2.1 2000/07/03 22:19:26 thorpej Exp $ */
/*
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
@@ -519,16 +519,17 @@
struct netconfig *ncp; /* where to put results */
{
char *tokenp; /* for processing tokens */
+ char *lasts;
nc_error = NC_BADFILE; /* nearly anything that breaks is for this reason */
stringp[strlen(stringp)-1] = '\0'; /* get rid of newline */
/* netid */
- if ((ncp->nc_netid = strtok(stringp, "\t ")) == NULL) {
+ if ((ncp->nc_netid = strtok_r(stringp, "\t ", &lasts)) == NULL) {
return (-1);
}
/* semantics */
- if ((tokenp = strtok(NULL, "\t ")) == NULL) {
+ if ((tokenp = strtok_r(NULL, "\t ", &lasts)) == NULL) {
return (-1);
}
if (strcmp(tokenp, NC_TPI_COTS_ORD_S) == 0)
@@ -543,7 +544,7 @@
return (-1);
/* flags */
- if ((tokenp = strtok(NULL, "\t ")) == NULL) {
+ if ((tokenp = strtok_r(NULL, "\t ", &lasts)) == NULL) {
return (-1);
}
for (ncp->nc_flag = NC_NOFLAG; *tokenp != '\0';
@@ -562,18 +563,18 @@
}
}
/* protocol family */
- if ((ncp->nc_protofmly = strtok(NULL, "\t ")) == NULL) {
+ if ((ncp->nc_protofmly = strtok_r(NULL, "\t ", &lasts)) == NULL) {
return (-1);
}
/* protocol name */
- if ((ncp->nc_proto = strtok(NULL, "\t ")) == NULL) {
+ if ((ncp->nc_proto = strtok_r(NULL, "\t ", &lasts)) == NULL) {
return (-1);
}
/* network device */
- if ((ncp->nc_device = strtok(NULL, "\t ")) == NULL) {
+ if ((ncp->nc_device = strtok_r(NULL, "\t ", &lasts)) == NULL) {
return (-1);
}
- if ((tokenp = strtok(NULL, "\t ")) == NULL) {
+ if ((tokenp = strtok_r(NULL, "\t ", &lasts)) == NULL) {
return (-1);
}
if (strcmp(tokenp, NC_NOLOOKUP) == 0) {
Home |
Main Index |
Thread Index |
Old Index