aft.c: Use correct format string for error output.
authorAndre Noll <maan@tuebingen.mpg.de>
Mon, 19 Dec 2016 23:12:19 +0000 (00:12 +0100)
committerAndre Noll <maan@tuebingen.mpg.de>
Mon, 19 Dec 2016 23:12:19 +0000 (00:12 +0100)
Both ->image_id and ->lyrics_id are of signed type.

Makefile.real
aft.c

index ce4881d..ef52c2e 100644 (file)
@@ -115,6 +115,7 @@ STRICT_CFLAGS += -Wno-sign-compare -Wno-unknown-pragmas
 STRICT_CFLAGS += -Wformat -Wformat-security
 STRICT_CFLAGS += -Wmissing-format-attribute
 STRICT_CFLAGS += -Wdeclaration-after-statement
+STRICT_CFLAGS += -Wformat-signedness
 
 LDFLAGS += $(clock_gettime_ldflags)
 
diff --git a/aft.c b/aft.c
index 7374db5..e48708a 100644 (file)
--- a/aft.c
+++ b/aft.c
@@ -2043,7 +2043,7 @@ static int com_touch_callback(struct afs_callback_arg *aca)
        if (cto->image_id >= 0) {
                ret = img_get_name_by_id(cto->image_id, NULL);
                if (ret < 0) {
-                       para_printf(&aca->pbout, "invalid image ID: %u\n",
+                       para_printf(&aca->pbout, "invalid image ID: %d\n",
                                cto->image_id);
                        return ret;
                }
@@ -2051,7 +2051,7 @@ static int com_touch_callback(struct afs_callback_arg *aca)
        if (cto->lyrics_id >= 0) {
                ret = lyr_get_name_by_id(cto->lyrics_id, NULL);
                if (ret < 0) {
-                       para_printf(&aca->pbout, "invalid lyrics ID: %u\n",
+                       para_printf(&aca->pbout, "invalid lyrics ID: %d\n",
                                cto->lyrics_id);
                        return ret;
                }