scan-build: fix a couple of minor warnings from a scan-build run

This commit is contained in:
Daniel Eklöf 2019-11-05 10:39:36 +01:00
parent 9abc5ca971
commit 15b12f45c6
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
6 changed files with 7 additions and 5 deletions

View file

@ -108,6 +108,7 @@ extract_selection(const struct terminal *term)
start_col = 0;
}
assert(idx > 0);
assert(idx < buf_size);
if (buf[idx - 1] == '\n')
buf[idx - 1] = '\0';