mirror of
https://github.com/neovim/neovim.git
synced 2026-01-22 13:12:54 +10:00
Merge pull request #1784 from elmart/coverity-issues-2
Fix coverity issues. (2)
This commit is contained in:
@@ -127,6 +127,7 @@ int setmark_pos(int c, pos_T *pos, int fnum)
|
||||
return OK;
|
||||
}
|
||||
if (isupper(c)) {
|
||||
assert(c >= 'A' && c <= 'Z');
|
||||
i = c - 'A';
|
||||
namedfm[i].fmark.mark = *pos;
|
||||
namedfm[i].fmark.fnum = fnum;
|
||||
@@ -1219,8 +1220,10 @@ int read_viminfo_filemark(vir_T *virp, int force)
|
||||
}
|
||||
} else if (VIM_ISDIGIT(*str))
|
||||
fm = &namedfm[*str - '0' + NMARKS];
|
||||
else
|
||||
else { // is uppercase
|
||||
assert(*str >= 'A' && *str <= 'Z');
|
||||
fm = &namedfm[*str - 'A'];
|
||||
}
|
||||
if (fm != NULL && (fm->fmark.mark.lnum == 0 || force)) {
|
||||
str = skipwhite(str + 1);
|
||||
fm->fmark.mark.lnum = getdigits(&str);
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
* the operators.
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <inttypes.h>
|
||||
#include <string.h>
|
||||
@@ -388,6 +389,7 @@ static int find_command(int cmdchar)
|
||||
|
||||
/* If the character is in the first part: The character is the index into
|
||||
* nv_cmd_idx[]. */
|
||||
assert(nv_max_linear < (int)NV_CMDS_SIZE);
|
||||
if (cmdchar <= nv_max_linear)
|
||||
return nv_cmd_idx[cmdchar];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user