diff options
author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-07-05 01:40:33 +0200 |
---|---|---|
committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-07-05 13:12:34 +0200 |
commit | aeb1b5f5b72081d190c9c24b3725cc09ce2bad1e (patch) | |
tree | 8be4b0f63873fbbc8ead653bb9676cf73c2b9d23 | |
parent | 709595b2979d7fcbc94b57236a8dca1a5d2dd4cb (diff) | |
download | sparse-aeb1b5f5b72081d190c9c24b3725cc09ce2bad1e.tar.gz |
sindex: avoid a warning with 'case -1:'
When parsing the format, there is a 'case -1:' which:
* seems to be there only for the following label (but mixing
labels with cases, like here, is OK).
* on architectures where chars are unsigned, the compiler complains:
warning: case label value is less than minimum value for type
So, remove the unneeded 'case -1:' and use an explicit 'default:'
to catch invalid formats. Also, align the label with the cases,
it looks nicer so.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Reviewed-by: Alexey Gladkov <gladkov.alexey@gmail.com>
-rw-r--r-- | sindex.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -970,8 +970,8 @@ static int search_query_callback(void *data, int argc, char **argv, char **colna print_file_line(argv[0], atoi(argv[1])); fmt++; break; - case -1: -print_string: + + print_string: if (n) { printf("%.*s", n, buf); n = 0; @@ -979,6 +979,9 @@ print_string: printf("%s", argv[colnum]); fmt++; break; + default: + break; + } if (pos == fmt) |