diff options
Diffstat (limited to 'src/misc2.c')
-rw-r--r-- | src/misc2.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/misc2.c b/src/misc2.c index 3f1568d10..beb3d4662 100644 --- a/src/misc2.c +++ b/src/misc2.c @@ -2092,6 +2092,7 @@ ga_concat_strings(gap, sep) /* * Concatenate a string to a growarray which contains characters. + * When "s" is NULL does not do anything. * Note: Does NOT copy the NUL at the end! */ void @@ -2099,8 +2100,11 @@ ga_concat(gap, s) garray_T *gap; char_u *s; { - int len = (int)STRLEN(s); + int len; + if (s == NULL) + return; + len = (int)STRLEN(s); if (ga_grow(gap, len) == OK) { mch_memmove((char *)gap->ga_data + gap->ga_len, s, (size_t)len); |