strtok -> strsep (no strtok allowed in libraries)
This commit is contained in:
parent
58751a777a
commit
e751e78811
@ -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') {
|
||||
|
@ -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') {
|
||||
|
Loading…
x
Reference in New Issue
Block a user