strtok -> strsep (no strtok allowed in libraries)

This commit is contained in:
Andrey A. Chernov 2000-08-29 21:49:11 +00:00
parent d9e630b592
commit c515991040
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=65222
2 changed files with 8 additions and 6 deletions

View File

@ -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') {

View File

@ -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') {