eval/encode: Silence V595 error

This commit is contained in:
ZyX
2017-05-20 03:47:01 +03:00
parent 7f24736ebc
commit 1db29cb5e5

View File

@@ -253,9 +253,11 @@ int encode_read_from_list(ListReaderState *const state, char *const buf,
char *const buf_end = buf + nbuf; char *const buf_end = buf + nbuf;
char *p = buf; char *p = buf;
while (p < buf_end) { while (p < buf_end) {
assert(state->li_length == 0 || state->li->li_tv.vval.v_string != NULL);
for (size_t i = state->offset; i < state->li_length && p < buf_end; i++) { for (size_t i = state->offset; i < state->li_length && p < buf_end; i++) {
const char ch = (char) state->li->li_tv.vval.v_string[state->offset++]; assert(state->li->li_tv.vval.v_string != NULL);
*p++ = (char) ((char) ch == (char) NL ? (char) NUL : (char) ch); const char ch = (char)state->li->li_tv.vval.v_string[state->offset++];
*p++ = (char)((char)ch == (char)NL ? (char)NUL : (char)ch);
} }
if (p < buf_end) { if (p < buf_end) {
state->li = state->li->li_next; state->li = state->li->li_next;