comparison src/getchar.c @ 22888:7ac9dea21baa v8.2.1991

patch 8.2.1991: Coverity warns for not using the ga_grow() return value Commit: https://github.com/vim/vim/commit/ca359cbedd0d603124776e7a6ca0ae79ffc34cdc Author: Bram Moolenaar <Bram@vim.org> Date: Sun Nov 15 20:49:41 2020 +0100 patch 8.2.1991: Coverity warns for not using the ga_grow() return value Problem: Coverity warns for not using the ga_grow() return value. Solution: Bail out if ga_grow() fails. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/7303)
author Bram Moolenaar <Bram@vim.org>
date Sun, 15 Nov 2020 21:00:03 +0100
parents 6d50182e7e24
children 1fe53aae3ba0
comparison
equal deleted inserted replaced
22887:d2fdcc5ed237 22888:7ac9dea21baa
3643 no_mapping++; 3643 no_mapping++;
3644 3644
3645 got_int = FALSE; 3645 got_int = FALSE;
3646 while (c1 != NUL && !aborted) 3646 while (c1 != NUL && !aborted)
3647 { 3647 {
3648 ga_grow(&line_ga, 32); 3648 if (ga_grow(&line_ga, 32) != OK)
3649 {
3650 aborted = TRUE;
3651 break;
3652 }
3649 3653
3650 if (vgetorpeek(FALSE) == NUL) 3654 if (vgetorpeek(FALSE) == NUL)
3651 { 3655 {
3652 // incomplete <Cmd> is an error, because there is not much the user 3656 // incomplete <Cmd> is an error, because there is not much the user
3653 // could do in this state. 3657 // could do in this state.