vim-patch:8.2.3328: Coverity error for not checking return value

Problem:    Coverity error for not checking return value.
Solution:   Check value is not negative.
b85d3627d9
This commit is contained in:
Sean Dewar 2021-08-13 17:25:54 +01:00
parent 2cbbab28d2
commit 17f377b6f9
No known key found for this signature in database
GPG Key ID: 08CC2C83AD41B581

View File

@ -1371,6 +1371,9 @@ static int read_compound(FILE *fd, slang_T *slang, int len)
gap = &slang->sl_comppat;
c = get2c(fd); // <comppatcount>
if (c < 0) {
return SP_TRUNCERROR;
}
todo -= 2;
ga_init(gap, sizeof(char_u *), c);
ga_grow(gap, c);