From: Timo Sirainen Date: Wed, 21 Dec 2016 16:35:05 +0000 (+0200) Subject: lib: istream-jsonstr - minor code cleanup X-Git-Tag: 2.3.0.rc1~2370 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=076c46c6513161e2c7bbe53d421b0830e9975fb1;p=thirdparty%2Fdovecot%2Fcore.git lib: istream-jsonstr - minor code cleanup If ret==0 here, it means dest wasn't changed, which must mean that i==0. Make it clear to avoid confusion. --- diff --git a/src/lib/istream-jsonstr.c b/src/lib/istream-jsonstr.c index 1425fbf4bd..9cddbcc95f 100644 --- a/src/lib/istream-jsonstr.c +++ b/src/lib/istream-jsonstr.c @@ -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);