icoutils/0022-wrestool-restable.c-Use-PRIu32-when-printing-a-uint3.patch
Richard W.M. Jones 86a1ed311e Add a series of upstream patches to enable compiler warnings and
fix multiple issues.

Revert one of the checks which breaks processing of PE binaries.

Removed the 'Group' line, not needed with modern Fedora/RPM.
2017-03-10 12:18:04 +00:00

37 lines
1.3 KiB
Diff
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

From b4ad077a134be781d8e973ded678e927de1cc733 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Thu, 9 Mar 2017 15:01:02 +0000
Subject: [PATCH 22/26] wrestool/restable.c: Use PRIu32 when printing a
uint32_t.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
restable.c: In function decode_pe_resource_id:
restable.c:199:40: error: format %d expects argument of type int, but argument 4 has type uint32_t {aka unsigned int} [-Werror=format=]
snprintf(wr->id, WINRES_ID_MAXLEN, "%d", value);
~^
%d
Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
---
wrestool/restable.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/wrestool/restable.c b/wrestool/restable.c
index df0ffd5..4a9f36a 100644
--- a/wrestool/restable.c
+++ b/wrestool/restable.c
@@ -196,7 +196,7 @@ decode_pe_resource_id (WinLibrary *fi, WinResource *wr, uint32_t value)
wr->id[len] = '\0';
} else { /* Unicode string id */
/* translate id into a string */
- snprintf(wr->id, WINRES_ID_MAXLEN, "%d", value);
+ snprintf(wr->id, WINRES_ID_MAXLEN, "%" PRIu32, value);
}
wr->numeric_id = (value & IMAGE_RESOURCE_NAME_IS_STRING ? false:true);
--
2.10.2