aboutsummaryrefslogtreecommitdiff
path: root/src/ex_cmds.c
diff options
context:
space:
mode:
authorFelipe Oliveira Carvalho <felipekde@gmail.com>2014-04-07 22:28:33 -0300
committerThiago de Arruda <tpadilha84@gmail.com>2014-04-11 12:57:59 -0300
commitf6b0e335e1f638e3c2d97e6886976d28d3798c32 (patch)
treec44159f894a036baa9e880f53cf3a2c3ba36adb7 /src/ex_cmds.c
parent457bb2615154946d273d75e07f5d5a936f50ede0 (diff)
downloadrneovim-f6b0e335e1f638e3c2d97e6886976d28d3798c32.tar.gz
rneovim-f6b0e335e1f638e3c2d97e6886976d28d3798c32.tar.bz2
rneovim-f6b0e335e1f638e3c2d97e6886976d28d3798c32.zip
Remove OOM error handling code after ga_grow() calls
Diffstat (limited to 'src/ex_cmds.c')
-rw-r--r--src/ex_cmds.c25
1 files changed, 7 insertions, 18 deletions
diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index 8b3a2a4bfd..7b04171286 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -5426,8 +5426,7 @@ void ex_helptags(exarg_T *eap)
break;
if (j == ga.ga_len) {
/* New language, add it. */
- if (ga_grow(&ga, 2) == FAIL)
- break;
+ ga_grow(&ga, 2);
((char_u *)ga.ga_data)[ga.ga_len++] = lang[0];
((char_u *)ga.ga_data)[ga.ga_len++] = lang[1];
}
@@ -5520,18 +5519,11 @@ helptags_one (
ga_init(&ga, (int)sizeof(char_u *), 100);
if (add_help_tags || path_full_compare((char_u *)"$VIMRUNTIME/doc",
dir, FALSE) == kEqualFiles) {
- if (ga_grow(&ga, 1) == FAIL)
- got_int = TRUE;
- else {
- s = alloc(18 + (unsigned)STRLEN(tagfname));
- if (s == NULL)
- got_int = TRUE;
- else {
- sprintf((char *)s, "help-tags\t%s\t1\n", tagfname);
- ((char_u **)ga.ga_data)[ga.ga_len] = s;
- ++ga.ga_len;
- }
- }
+ ga_grow(&ga, 1);
+ s = alloc(18 + (unsigned)STRLEN(tagfname));
+ sprintf((char *)s, "help-tags\t%s\t1\n", tagfname);
+ ((char_u **)ga.ga_data)[ga.ga_len] = s;
+ ++ga.ga_len;
}
/*
@@ -5598,10 +5590,7 @@ helptags_one (
|| s[1] == '\0')) {
*p2 = '\0';
++p1;
- if (ga_grow(&ga, 1) == FAIL) {
- got_int = TRUE;
- break;
- }
+ ga_grow(&ga, 1);
s = alloc((unsigned)(p2 - p1 + STRLEN(fname) + 2));
if (s == NULL) {
got_int = TRUE;