[sharutils PATCH] build: avoid error message failure on 64-bit hosts
Eric Blake <[email protected]> Tue, 6 Jan 2015 17:12:30 -0700
| Newsgroups | gmane.comp.gnu.utils.bugs |
|---|---|
| Message-ID | <[email protected]> |
Detected when compiling with CFLAGS='-Wall -Werror':
scribble.c: In function ‘xscribble_get’:
scribble.c:166:9: error: format ‘%u’ expects argument of type ‘unsigned int’, but argument 3 has type ‘ssize_t’ [-Werror=format=]
fprintf(stderr, _("could not allocate %u bytes of scribble space"), sz);
^
* src/scribble.c (xscribble_get): Use correct specifier.
Signed-off-by: Eric Blake <[email protected]>
---
ChangeLog | 5 +++++
src/scribble.c | 3 ++-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index 473d746..4c7fa2a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2015-01-06 Eric Blake <[email protected]>
+
+ build: avoid error message failure on 64-bit hosts
+ * src/scribble.c (xscribble_get): Use correct specifier.
+
2013-04-13 Bruce Korb <[email protected]>
* src/shar.c (open_encoded_file): split out code that must vary
diff --git a/src/scribble.c b/src/scribble.c
index 01058ed..1e7e4a4 100644
--- a/src/scribble.c
+++ b/src/scribble.c
@@ -163,7 +163,8 @@ xscribble_get(ssize_t sz)
{
void * p = scribble_get(sz);
if (p == NULL) {
- fprintf(stderr, _("could not allocate %u bytes of scribble space"), sz);
+ fprintf(stderr, _("could not allocate %zu bytes of scribble space"),
+ sz);
exit(EXIT_FAILURE);
}
return p;
--
2.1.0