From e9e9e427b78271941a25a63567fc2ec2bb9e4433 Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Mon, 23 Oct 2017 19:19:13 +0200 Subject: vty: Fix bad use of vector_slot() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes the compilation warning below: git/libosmocore/src/vty/command.c: In function ‘cmd_complete_command_real’: git/libosmocore/src/vty/command.c:1953:33: warning: comparison between pointer and zero character const ant [-Wpointer-compare] if (vector_slot(vline, index) == '\0') ^~ git/libosmocore/src/vty/command.c:37:0: git/libosmocore/include/osmocom/vty/vector.h:39:27: note: did you mean to dereference the pointer? #define vector_slot(V,I) ((V)->index[(I)]) ^ git/libosmocore/src/vty/command.c:1953:7: note: in expansion of macro ‘vector_slot’ if (vector_slot(vline, index) == '\0') ^~~~~~~~~~~ Change-Id: Iaba9e3450d68c51e16a7bda2fc0fc370992ca866 --- src/vty/command.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/vty/command.c') diff --git a/src/vty/command.c b/src/vty/command.c index 21b26b4e..355fb5d8 100644 --- a/src/vty/command.c +++ b/src/vty/command.c @@ -1950,7 +1950,7 @@ static char **cmd_complete_command_real(vector vline, struct vty *vty, /* In case of 'command \t' pattern. Do you need '?' command at the end of the line. */ - if (vector_slot(vline, index) == '\0') + if (*(char *)vector_slot(vline, index) == '\0') *status = CMD_ERR_NOTHING_TODO; else *status = CMD_ERR_NO_MATCH; -- cgit v1.2.3