From: Felix Fietkau Date: Fri, 25 Jan 2008 14:18:52 +0000 (+0100) Subject: initialize strtok_r context to NULL X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fuci.git;a=commitdiff_plain;h=a5c84bef36cf36977a8271905f3c906bb612e484 initialize strtok_r context to NULL --- diff --git a/file.c b/file.c index 36ef346..470071e 100644 --- a/file.c +++ b/file.c @@ -374,13 +374,13 @@ static void uci_parse_option(struct uci_context *ctx, char **str) static void uci_parse_line(struct uci_context *ctx) { struct uci_parse_context *pctx = ctx->pctx; - char *word, *brk; + char *word, *brk = NULL; for (word = strtok_r(pctx->buf, ";", &brk); word; word = strtok_r(NULL, ";", &brk)) { - char *pbrk; + char *pbrk = NULL; word = strtok_r(word, " \t", &pbrk); switch(word[0]) {