* fixup StrBufRemove_token
authorWilfried Göesgens <willi@citadel.org>
Sun, 8 Feb 2009 09:29:05 +0000 (09:29 +0000)
committerWilfried Göesgens <willi@citadel.org>
Sun, 8 Feb 2009 09:29:05 +0000 (09:29 +0000)
libcitadel/lib/stringbuf.c

index ba1c12c173b222e8cefbbbcbf8bc1e0676ebfd0c..f669ecf362ae895a76d078358a58e8fb9fda6ad6 100644 (file)
@@ -849,12 +849,13 @@ int StrBufRemove_token(StrBuf *Source, int parmnum, char separator)
        while (*s && *s != separator) {
                s++;
        }
-
+       if (*s == separator)
+               s++;
        ReducedBy = d - s;
 
        /* Hack and slash */
        if (*s) {
-               memmove(d, s, Source->BufUsed - (s - Source->buf));
+               memmove(d, s, Source->BufUsed - (s - Source->buf) + 1);
                Source->BufUsed -= (ReducedBy + 1);
        }
        else if (d == Source->buf) {