From 43351e03cd3d008729fd12244a171dfca9842bd5 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Mon, 29 Dec 2014 07:44:00 +0100 Subject: [PATCH] parsing needs to return a static buffer if it has no argument --- src/util/parser.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/util/parser.c b/src/util/parser.c index 62a2a37fe..b927a99a0 100644 --- a/src/util/parser.c +++ b/src/util/parser.c @@ -201,16 +201,15 @@ char *parse_token(const char **str, char *lbuf, size_t buflen) return lbuf; } +static char pbuf[MAXTOKENSIZE]; /* STATIC_RESULT: used for return, not across calls */ const char *parse_token_depr(const char **str) { - static char lbuf[MAXTOKENSIZE]; /* STATIC_RESULT: used for return, not across calls */ - return parse_token(str, lbuf, MAXTOKENSIZE); + return parse_token(str, pbuf, MAXTOKENSIZE); } const char *getstrtoken(void) { - char lbuf[MAXTOKENSIZE]; - return parse_token((const char **)&states->current_token, lbuf, MAXTOKENSIZE); + return parse_token((const char **)&states->current_token, pbuf, MAXTOKENSIZE); } const char *gettoken(char *lbuf, size_t bufsize)