From d4f0059a151fb3340cb9518a6981282831abb7ed Mon Sep 17 00:00:00 2001 From: Wilfried Goesgens Date: Sun, 26 Dec 2010 13:22:55 +0100 Subject: [PATCH] StrBuf_NextToken: if the source is empty, flush the target. --- libcitadel/lib/stringbuf.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libcitadel/lib/stringbuf.c b/libcitadel/lib/stringbuf.c index 6d8f549d3..dfba39d7e 100644 --- a/libcitadel/lib/stringbuf.c +++ b/libcitadel/lib/stringbuf.c @@ -1502,6 +1502,8 @@ int StrBufExtract_NextToken(StrBuf *dest, const StrBuf *Source, const char **pSt (Source->BufUsed == 0) ) { *pStart = StrBufNOTNULL; + if (dest != NULL) + FlushStrBuf(dest); return -1; } -- 2.30.2