mirror of
https://github.com/troglobit/editline.git
synced 2025-07-08 02:01:13 +08:00
Attempt to work around slightly bogus Coverity warnings.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
parent
9fbad9dbff
commit
7abfadd7e6
@ -1701,7 +1701,7 @@ static el_status_t el_bind_key_in_map(int key, el_keymap_func_t function, el_key
|
|||||||
|
|
||||||
/* Must check that pos is not the next to last array position,
|
/* Must check that pos is not the next to last array position,
|
||||||
* otherwise we will write out-of-bounds to terminate the list. */
|
* otherwise we will write out-of-bounds to terminate the list. */
|
||||||
if (pos >= mapsz - 1) {
|
if (pos + 1 >= mapsz) {
|
||||||
errno = ENOMEM;
|
errno = ENOMEM;
|
||||||
return CSeof;
|
return CSeof;
|
||||||
}
|
}
|
||||||
@ -1710,8 +1710,8 @@ static el_status_t el_bind_key_in_map(int key, el_keymap_func_t function, el_key
|
|||||||
creat = map[pos].Function == NULL;
|
creat = map[pos].Function == NULL;
|
||||||
|
|
||||||
/* A new key so have to add it to end */
|
/* A new key so have to add it to end */
|
||||||
map[pos].Key = key;
|
map[pos].Key = key;
|
||||||
map[pos].Function = function;
|
map[pos].Function = function;
|
||||||
|
|
||||||
/* Terminate list */
|
/* Terminate list */
|
||||||
if (creat) {
|
if (creat) {
|
||||||
|
Loading…
Reference in New Issue
Block a user