diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2017-01-22 22:04:00 +0100 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2017-01-23 15:49:37 +0100 |
commit | d97d66e173b11a26015a99bed8467081d9c8733e (patch) | |
tree | 52c9c59914cecd1e487aae61b2904f7ff5d3a2a1 /src/nvim/ex_cmds.c | |
parent | 6be8ea07872ac8badd3645a51017c32b0b90d59e (diff) | |
download | rneovim-d97d66e173b11a26015a99bed8467081d9c8733e.tar.gz rneovim-d97d66e173b11a26015a99bed8467081d9c8733e.tar.bz2 rneovim-d97d66e173b11a26015a99bed8467081d9c8733e.zip |
coverity/155512: Pass correct length to strncat()
References 8bc2bffda94bf2de4e8adae57b4b5597ed4e8247
Diffstat (limited to 'src/nvim/ex_cmds.c')
-rw-r--r-- | src/nvim/ex_cmds.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c index 19d8acd75a..56919db024 100644 --- a/src/nvim/ex_cmds.c +++ b/src/nvim/ex_cmds.c @@ -1408,8 +1408,8 @@ char_u *make_filter_cmd(char_u *cmd, char_u *itmp, char_u *otmp) } if (itmp != NULL) { - strncat(buf, " < ", len - 1); - strncat(buf, (const char *)itmp, len - 1); + xstrlcat(buf, " < ", len - 1); + xstrlcat(buf, (const char *)itmp, len - 1); } #else // For shells that don't understand braces around commands, at least allow @@ -1425,13 +1425,13 @@ char_u *make_filter_cmd(char_u *cmd, char_u *itmp, char_u *otmp) *p = NUL; } } - strncat(buf, " < ", len); - strncat(buf, (const char *)itmp, len); + xstrlcat(buf, " < ", len); + xstrlcat(buf, (const char *)itmp, len); if (*p_shq == NUL) { const char *const p = strchr((const char *)cmd, '|'); if (p != NULL) { - strncat(buf, " ", len - 1); // Insert a space before the '|' for DOS - strncat(buf, p, len - 1); + xstrlcat(buf, " ", len - 1); // Insert a space before the '|' for DOS + xstrlcat(buf, p, len - 1); } } } |