From 57193d3437f2bf6d0948c6c6e6e820ca520b6977 Mon Sep 17 00:00:00 2001 From: schippes Date: Tue, 18 Aug 2020 09:39:29 +0200 Subject: [PATCH] fix list_tokens(), reallocation of token was terminating the string at 1st char --- src/token.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/token.c b/src/token.c index 2231b01b..b658d219 100644 --- a/src/token.c +++ b/src/token.c @@ -413,7 +413,7 @@ const char *list_tokens(const char *s, int with_quotes) if(s==NULL) { my_free(435, &token); sizetok = 0; - return "";; + return ""; } sizetok = CADCHUNKALLOC; my_realloc(451, &token, sizetok); @@ -428,7 +428,6 @@ const char *list_tokens(const char *s, int with_quotes) if(token_pos>=sizetok) { sizetok+=CADCHUNKALLOC; my_realloc(434, &token,sizetok); - token[0] = '\0'; } if(c=='"') { if(!escape) quote=!quote;