]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: istream-jsonstr - minor code cleanup
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Wed, 21 Dec 2016 16:35:05 +0000 (18:35 +0200)
committerGitLab <gitlab@git.dovecot.net>
Fri, 23 Dec 2016 18:08:49 +0000 (20:08 +0200)
If ret==0 here, it means dest wasn't changed, which must mean that i==0.
Make it clear to avoid confusion.

src/lib/istream-jsonstr.c

index 1425fbf4bd0819281ea83cfcd0982da8e892012c..9cddbcc95fcd5ed5484b485b1494538352cc65bf 100644 (file)
@@ -154,8 +154,9 @@ static ssize_t i_stream_jsonstr_read(struct istream_private *stream)
        ret = dest - stream->pos;
        if (ret == 0) {
                /* not enough input */
+               i_assert(i == 0);
                i_assert(extra > 0);
-               ret = i_stream_jsonstr_read_parent(jstream, i+extra+1);
+               ret = i_stream_jsonstr_read_parent(jstream, extra+1);
                if (ret <= 0)
                        return ret;
                return i_stream_jsonstr_read(stream);