]> granicus.if.org Git - libvpx/commitdiff
Fix format-string warning
authorRalph Giles <giles@xiph.org>
Mon, 7 Mar 2011 21:00:05 +0000 (13:00 -0800)
committerRalph Giles <giles@xiph.org>
Mon, 7 Mar 2011 21:21:39 +0000 (13:21 -0800)
Cast size_t to (unsigned long) and print it with the %lu format
string, which is more portable than C99's explict %zu for size_t.

This truncates on Windows x64 but otherwise works on 32 and 64 bit
platforms. In practice the stats file is unlikely to be so large.

Change-Id: I0432b3acf85fc6ba4ad50640942e1ca4614b21cb

vpxenc.c

index d0f4c23482dd94c3f3332f3a690f39b4bd97d90a..7b8de1171ea98d2f9efbbc25585c9ae8bbb75469 100755 (executable)
--- a/vpxenc.c
+++ b/vpxenc.c
@@ -163,8 +163,8 @@ int stats_open_file(stats_io_t *stats, const char *fpf, int pass)
 
         if (!stats->buf.buf)
         {
-            fprintf(stderr, "Failed to allocate first-pass stats buffer (%d bytes)\n",
-                    stats->buf_alloc_sz);
+            fprintf(stderr, "Failed to allocate first-pass stats buffer (%lu bytes)\n",
+                    (unsigned long)stats->buf_alloc_sz);
             exit(EXIT_FAILURE);
         }