bug-gzip
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] * gzip.c (get_method): don't assume size_t can be printed with %


From: Paul Eggert
Subject: [PATCH] * gzip.c (get_method): don't assume size_t can be printed with %u
Date: Mon, 19 Jul 2010 09:46:56 -0700
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.10) Gecko/20100527 Thunderbird/3.0.5

I installed this fix to a trivial printf formatting portability
bug that I introduced recently: it's not portable to print a size_t
value with %u.

>From 508a84e83f5963e4b39280a87ea4f6d2d0b7fe86 Mon Sep 17 00:00:00 2001
From: Paul R. Eggert <address@hidden>
Date: Mon, 19 Jul 2010 09:42:05 -0700
Subject: [PATCH] * gzip.c (get_method): don't assume size_t can be printed with 
%u

---
 gzip.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/gzip.c b/gzip.c
index 0443e16..65f5897 100644
--- a/gzip.c
+++ b/gzip.c
@@ -1368,7 +1368,7 @@ local int get_method(in)
 
         if ((flags & EXTRA_FIELD) != 0) {
             uch lenbuf[2];
-            size_t len = lenbuf[0] = get_byte ();
+            unsigned int len = lenbuf[0] = get_byte ();
             len |= (lenbuf[1] = get_byte ()) << 8;
             if (verbose) {
                 fprintf(stderr,"%s: %s: extra field of %u bytes ignored\n",
-- 
1.7.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]