From: Wilfried Goesgens Date: Sun, 26 Dec 2010 12:22:55 +0000 (+0100) Subject: StrBuf_NextToken: if the source is empty, flush the target. X-Git-Tag: v8.11~1139 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=d4f0059a151fb3340cb9518a6981282831abb7ed;ds=sidebyside StrBuf_NextToken: if the source is empty, flush the target. --- 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; }