diff options
author | Bram Moolenaar <bram@vim.org> | 2010-09-29 18:32:52 +0200 |
---|---|---|
committer | Bram Moolenaar <bram@vim.org> | 2010-09-29 18:32:52 +0200 |
commit | 5f8679b53cf2100bcba5ff6265893ea035fc4d25 (patch) | |
tree | bdd4c3d555c481e91faf2e1a64b6c9aba6aadbcc | |
parent | 49efa2b96973d50427ebbb3ad258a08f73a45129 (diff) | |
download | vim-5f8679b53cf2100bcba5ff6265893ea035fc4d25.tar.gz |
Problem: smatch reports errors.
Solution: Fix the reported errors. (Dominique Pelle)
-rw-r--r-- | src/spell.c | 10 | ||||
-rw-r--r-- | src/syntax.c | 4 | ||||
-rw-r--r-- | src/version.c | 2 |
3 files changed, 10 insertions, 6 deletions
diff --git a/src/spell.c b/src/spell.c index caffab6b..d34cc945 100644 --- a/src/spell.c +++ b/src/spell.c @@ -4951,7 +4951,7 @@ typedef struct spellinfo_S char_u *si_info; /* info text chars or NULL */ int si_region_count; /* number of regions supported (1 when there are no regions) */ - char_u si_region_name[16]; /* region names; used only if + char_u si_region_name[17]; /* region names; used only if * si_region_count > 1) */ garray_T si_rep; /* list of fromto_T entries from REP lines */ @@ -9530,7 +9530,8 @@ init_spellfile() if (aspath) /* Use directory of an entry with path, e.g., for * "/dir/lg.utf-8.spl" use "/dir". */ - vim_strncpy(buf, curbuf->b_s.b_p_spl, lstart - curbuf->b_s.b_p_spl - 1); + vim_strncpy(buf, curbuf->b_s.b_p_spl, + lstart - curbuf->b_s.b_p_spl - 1); else /* Copy the path from 'runtimepath' to buf[]. */ copy_option_part(&rtp, buf, MAXPATHL, ","); @@ -9539,13 +9540,14 @@ init_spellfile() /* Use the first language name from 'spelllang' and the * encoding used in the first loaded .spl file. */ if (aspath) - vim_strncpy(buf, curbuf->b_s.b_p_spl, lend - curbuf->b_s.b_p_spl); + vim_strncpy(buf, curbuf->b_s.b_p_spl, + lend - curbuf->b_s.b_p_spl); else { /* Create the "spell" directory if it doesn't exist yet. */ l = (int)STRLEN(buf); vim_snprintf((char *)buf + l, MAXPATHL - l, "/spell"); - if (!filewritable(buf) != 2) + if (filewritable(buf) != 2) vim_mkdir(buf, 0755); l = (int)STRLEN(buf); diff --git a/src/syntax.c b/src/syntax.c index fbc123cc..d2a99a4f 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -7600,10 +7600,10 @@ do_highlight(line, forceit, init) /* * Copy characters from arg[] to buf[], translating <> codes. */ - for (p = arg, off = 0; off < 100 && *p; ) + for (p = arg, off = 0; off < 100 - 6 && *p; ) { len = trans_special(&p, buf + off, FALSE); - if (len) /* recognized special char */ + if (len > 0) /* recognized special char */ off += len; else /* copy as normal char */ buf[off++] = *p++; diff --git a/src/version.c b/src/version.c index b3fc12e4..d04419c3 100644 --- a/src/version.c +++ b/src/version.c @@ -715,6 +715,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 17, +/**/ 16, /**/ 15, |