Fix GCC warning:
src/dbus.c: In function ‘near_dbus_encode_string’:
src/dbus.c:71:37: error: format ‘%x’ expects argument of type ‘unsigned int’, but
argument 3 has type ‘int’ [-Werror=format=]
71 | g_string_append_printf(str, "_%02x", tmp);
| ~~~^ ~~~
| | |
| | int
| unsigned int
| %02x
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski(a)canonical.com>
---
src/dbus.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/dbus.c b/src/dbus.c
index 9c67a9eec89a..ed4570d951ed 100644
--- a/src/dbus.c
+++ b/src/dbus.c
@@ -68,7 +68,7 @@ char *near_dbus_encode_string(const char *value)
const char tmp = value[i];
if ((tmp < '0' || tmp > '9') && (tmp < 'A' ||
tmp > 'Z') &&
(tmp < 'a' || tmp > 'z'))
- g_string_append_printf(str, "_%02x", tmp);
+ g_string_append_printf(str, "_%02x", (unsigned int)tmp);
else
str = g_string_append_c(str, tmp);
}
--
2.27.0