aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/syntax.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2014-06-13 18:09:08 -0400
committerJustin M. Keyes <justinkz@gmail.com>2014-06-13 18:09:08 -0400
commit8bbeb4b480a72d0099a18c4d8200313600045231 (patch)
treecf153eceb121aef15e50631282e9171a24b74406 /src/nvim/syntax.c
parent5b3b3fd3ed4372866730ae857e8c09d6e5d1167d (diff)
parentd430f039d1255eaab55470b5613d83c24d030a64 (diff)
downloadrneovim-8bbeb4b480a72d0099a18c4d8200313600045231.tar.gz
rneovim-8bbeb4b480a72d0099a18c4d8200313600045231.tar.bz2
rneovim-8bbeb4b480a72d0099a18c4d8200313600045231.zip
Merge #743 'Replace vim_strncpy with strlcpy'
Diffstat (limited to 'src/nvim/syntax.c')
-rw-r--r--src/nvim/syntax.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c
index ad8d4fb03d..6b4ab867f2 100644
--- a/src/nvim/syntax.c
+++ b/src/nvim/syntax.c
@@ -2915,7 +2915,7 @@ check_keyword_id (
* Must make a copy of the keyword, so we can add a NUL and make it
* lowercase.
*/
- vim_strncpy(keyword, kwp, kwlen);
+ STRLCPY(keyword, kwp, kwlen + 1);
keyentry_T *kp = NULL;
@@ -5122,7 +5122,7 @@ get_id_list (
for (end = p; *end && !vim_iswhite(*end) && *end != ','; ++end)
;
name = xmalloc((int)(end - p + 3)); /* leave room for "^$" */
- vim_strncpy(name + 1, p, end - p);
+ STRLCPY(name + 1, p, end - p + 1);
if ( STRCMP(name + 1, "ALLBUT") == 0
|| STRCMP(name + 1, "ALL") == 0
|| STRCMP(name + 1, "TOP") == 0
@@ -7229,7 +7229,7 @@ int syn_name2id(char_u *name)
/* Avoid using stricmp() too much, it's slow on some systems */
/* Avoid alloc()/free(), these are slow too. ID names over 200 chars
* don't deserve to be found! */
- vim_strncpy(name_u, name, 199);
+ STRLCPY(name_u, name, 200);
vim_strup(name_u);
for (i = highlight_ga.ga_len; --i >= 0; )
if (HL_TABLE()[i].sg_name_u != NULL