diff options
Diffstat (limited to 'lib/libtacplus/taclib.c')
-rw-r--r-- | lib/libtacplus/taclib.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/libtacplus/taclib.c b/lib/libtacplus/taclib.c index 6c1fbd2..45ba4d4 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') { |