mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Fix warnings: cursor_shape.c: parse_shape_opt(): Garbage value: FP.
Problem: Assigned value is garbage or undefined @ 187. http://neovim.org/doc/reports/clang/report-7b7d61.html#EndPath. Diagnostic: False positive. Rationale : `colonp`, must be `>= modep, or null` by `vim_strchr` postcondition. At this point we also it's not null and it's not equal to `modep`, by previous code. So, it must be `> modep`. Resolution: Assert `colonp > modep`.
This commit is contained in:
parent
4cc26fba24
commit
b6c1fae6a9
@ -1,3 +1,4 @@
|
|||||||
|
#include <assert.h>
|
||||||
#include "nvim/vim.h"
|
#include "nvim/vim.h"
|
||||||
#include "nvim/ascii.h"
|
#include "nvim/ascii.h"
|
||||||
#include "nvim/cursor_shape.h"
|
#include "nvim/cursor_shape.h"
|
||||||
@ -76,6 +77,7 @@ char_u *parse_shape_opt(int what)
|
|||||||
* For the 'a' mode, we loop to handle all the modes.
|
* For the 'a' mode, we loop to handle all the modes.
|
||||||
*/
|
*/
|
||||||
all_idx = -1;
|
all_idx = -1;
|
||||||
|
assert(modep < colonp);
|
||||||
while (modep < colonp || all_idx >= 0) {
|
while (modep < colonp || all_idx >= 0) {
|
||||||
if (all_idx < 0) {
|
if (all_idx < 0) {
|
||||||
/* Find the mode. */
|
/* Find the mode. */
|
||||||
|
Loading…
Reference in New Issue
Block a user