From 735792ded03a83f100638e52a727cbce1753291a Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Wed, 6 Feb 2008 15:47:04 +0100 Subject: [PATCH] use strsep instead of strtok to avoid a segfault --- util.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/util.c b/util.c index 1d71335..eb50b89 100644 --- a/util.c +++ b/util.c @@ -103,15 +103,15 @@ int uci_parse_tuple(struct uci_context *ctx, char *str, char **package, char **s last++; } - *package = strtok(str, "."); + *package = strsep(&str, "."); if (!*package || !uci_validate_name(*package)) goto error; - *section = strtok(NULL, "."); + *section = strsep(&str, "."); if (!*section) goto lastval; - *option = strtok(NULL, "."); + *option = strsep(&str, "."); if (!*option) goto lastval; -- 2.25.1