From: Junio C Hamano Date: Sat, 18 Apr 2020 23:12:06 GMT Subject: Re: [PATCH] mailinfo.c::convert_to_utf8: reuse strlen info Message-ID: In-Reply-To: Martin Ă…gren writes: > This is equivalent as long as `line->len` is equal to > `strlen(line->buf)`, which it will be (should be) because it's a > strbuf. Ok. For the guarantee to hold true, line->buf[0..line->len] should not have any '\0' byte in it. This helper has two callers, but in either case, it needs to be prepared to work on output of decode_[bq]_segment(). Is there code anywhere that guarntees that the decoding won't stuff '\0' in the line?