diff options
author | Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> | 2021-07-09 12:59:16 +0200 |
---|---|---|
committer | Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> | 2021-07-19 12:36:25 +0200 |
commit | 78395b8dbaf14cf35d913caa83fdd710bc293fb8 (patch) | |
tree | 67239827ddd53f013f7b7c3fb0d20e30d15ec9ea | |
parent | 5ec78b7eb08bf1c857383ce627e8b65e1d67e902 (diff) | |
download | neard-78395b8dbaf14cf35d913caa83fdd710bc293fb8.tar.gz |
dbus: fix -Wformat in near_dbus_encode_string()
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@canonical.com>
-rw-r--r-- | src/dbus.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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); } |