aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEliseo Martínez <eliseomarmol@gmail.com>2014-11-04 15:41:35 +0100
committerEliseo Martínez <eliseomarmol@gmail.com>2014-11-06 09:51:42 +0100
commitb6c1fae6a94d01024d30c24c32e99ec78b4b2517 (patch)
treecbbbbd3dc82abf07e2d63485f3f7c304df7afee1
parent4cc26fba249361cccd791a76fc35c46d851096a5 (diff)
downloadrneovim-b6c1fae6a94d01024d30c24c32e99ec78b4b2517.tar.gz
rneovim-b6c1fae6a94d01024d30c24c32e99ec78b4b2517.tar.bz2
rneovim-b6c1fae6a94d01024d30c24c32e99ec78b4b2517.zip
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`.
-rw-r--r--src/nvim/cursor_shape.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/nvim/cursor_shape.c b/src/nvim/cursor_shape.c
index 9992fbdfcf..328b751693 100644
--- a/src/nvim/cursor_shape.c
+++ b/src/nvim/cursor_shape.c
@@ -1,3 +1,4 @@
+#include <assert.h>
#include "nvim/vim.h"
#include "nvim/ascii.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.
*/
all_idx = -1;
+ assert(modep < colonp);
while (modep < colonp || all_idx >= 0) {
if (all_idx < 0) {
/* Find the mode. */