From 867417de2a2ccf2cb0106646e65d1f19aa12a49f Mon Sep 17 00:00:00 2001
From: Andreas Mohr <and@gmx.li>
Date: Sat, 17 Sep 2016 12:04:35 +0000
Subject: [PATCH] (hex.c) Cleanup -Wformat-signedness warning
Cleanup -Wformat-signedness warning.
hex.c: In function 'mc_search__hex_translate_to_regex':
hex.c:79:39: error: format '%x' expects argument of type 'unsigned int *', but argument 3 has type 'int *' [-Wformat=]
if (sscanf (tmp_str + loop, "%x%n", &val, &ptr))
^
Signed-off-by: Andreas Mohr <and@gmx.li>
---
lib/search/hex.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/lib/search/hex.c b/lib/search/hex.c
index 9e3dbcd..d0d2abe 100644
a
|
b
|
mc_search__hex_translate_to_regex (const GString * astr) |
73 | 73 | |
74 | 74 | while (loop < tmp_str_len) |
75 | 75 | { |
76 | | int val, ptr; |
| 76 | unsigned int val; |
| 77 | int ptr; |
77 | 78 | |
78 | 79 | /* cppcheck-suppress invalidscanf */ |
79 | 80 | if (sscanf (tmp_str + loop, "%x%n", &val, &ptr)) |
80 | 81 | { |
81 | | if (val < -128 || val > 255) |
| 82 | if (val > 255) |
82 | 83 | loop++; |
83 | 84 | else |
84 | 85 | { |