From e751e78811592941f8f93161f2fb1adef30bf953 Mon Sep 17 00:00:00 2001 From: ache Date: Tue, 29 Aug 2000 21:49:11 +0000 Subject: [PATCH] strtok -> strsep (no strtok allowed in libraries) --- lib/libradius/radlib.c | 7 ++++--- lib/libtacplus/taclib.c | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/libradius/radlib.c b/lib/libradius/radlib.c index 1860fedd9ee3..47421065743c 100644 --- a/lib/libradius/radlib.c +++ b/lib/libradius/radlib.c @@ -305,7 +305,7 @@ rad_config(struct rad_handle *h, const char *path) int nfields; char msg[ERRSIZE]; char *type; - char *host; + char *host, *res; char *port_str; char *secret; char *timeout_str; @@ -378,8 +378,9 @@ rad_config(struct rad_handle *h, const char *path) continue; /* Parse and validate the fields. */ - host = strtok(host, ":"); - port_str = strtok(NULL, ":"); + res = host; + host = strsep(&res, ":"); + port_str = strsep(&res, ":"); if (port_str != NULL) { port = strtoul(port_str, &end, 10); if (*end != '\0') { diff --git a/lib/libtacplus/taclib.c b/lib/libtacplus/taclib.c index 6c1fbd213e53..45ba4d4ada84 100644 --- a/lib/libtacplus/taclib.c +++ b/lib/libtacplus/taclib.c @@ -771,7 +771,7 @@ tac_config(struct tac_handle *h, const char *path) char *fields[4]; int nfields; char msg[ERRSIZE]; - char *host; + char *host, *res; char *port_str; char *secret; char *timeout_str; @@ -817,8 +817,9 @@ tac_config(struct tac_handle *h, const char *path) options_str = fields[3]; /* Parse and validate the fields. */ - host = strtok(host, ":"); - port_str = strtok(NULL, ":"); + res = host; + host = strsep(&res, ":"); + port_str = strsep(&res, ":"); if (port_str != NULL) { port = strtoul(port_str, &end, 10); if (port_str[0] == '\0' || *end != '\0') {