diff options
Diffstat (limited to 'src/getchar.c')
-rw-r--r-- | src/getchar.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/getchar.c b/src/getchar.c index 311fe584d..bc30d6c99 100644 --- a/src/getchar.c +++ b/src/getchar.c @@ -257,8 +257,7 @@ add_buff(buf, s, slen) if (buf->bh_space >= (int)slen) { len = (long_u)STRLEN(buf->bh_curr->b_str); - STRNCPY(buf->bh_curr->b_str + len, s, slen); - buf->bh_curr->b_str[len + slen] = NUL; + vim_strncpy(buf->bh_curr->b_str + len, s, (size_t)slen); buf->bh_space -= slen; } else @@ -272,8 +271,7 @@ add_buff(buf, s, slen) if (p == NULL) return; /* no space, just forget it */ buf->bh_space = len - slen; - STRNCPY(p->b_str, s, slen); - p->b_str[slen] = NUL; + vim_strncpy(p->b_str, s, (size_t)slen); p->b_next = buf->bh_curr->b_next; buf->bh_curr->b_next = p; |