Mercurial > vim
comparison src/evalfunc.c @ 31837:e16361210675 v9.0.1251
patch 9.0.1251: checking returned value of ga_grow() is inconsistent
Commit: https://github.com/vim/vim/commit/fadc02a2a57755fa1342b1b44c2ceab3046125fc
Author: Yegappan Lakshmanan <yegappan@yahoo.com>
Date: Fri Jan 27 21:03:12 2023 +0000
patch 9.0.1251: checking returned value of ga_grow() is inconsistent
Problem: Checking returned value of ga_grow() is inconsistent.
Solution: Check for FAIL instaed of "not OK". (Yegappan Lakshmanan,
closes #11897)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 27 Jan 2023 22:15:03 +0100 |
parents | ddbc560ecc41 |
children | 16025ef158bf |
comparison
equal
deleted
inserted
replaced
31836:f800c5e0c695 | 31837:e16361210675 |
---|---|
3964 | 3964 |
3965 if (value_len == -1) | 3965 if (value_len == -1) |
3966 len = (int)STRLEN(value); // Append the entire string | 3966 len = (int)STRLEN(value); // Append the entire string |
3967 else | 3967 else |
3968 len = value_len; // Append only "value_len" characters | 3968 len = value_len; // Append only "value_len" characters |
3969 if (ga_grow(&redir_execute_ga, len) != OK) | 3969 if (ga_grow(&redir_execute_ga, len) == FAIL) |
3970 return; | 3970 return; |
3971 | 3971 |
3972 mch_memmove((char *)redir_execute_ga.ga_data | 3972 mch_memmove((char *)redir_execute_ga.ga_data |
3973 + redir_execute_ga.ga_len, value, len); | 3973 + redir_execute_ga.ga_len, value, len); |
3974 redir_execute_ga.ga_len += len; | 3974 redir_execute_ga.ga_len += len; |