]> www.infradead.org Git - mtd-utils.git/commitdiff
serve_image: adjust classifier and type for printf
authorAndy Shevchenko <ext-andriy.shevchenko@nokia.com>
Wed, 20 Apr 2011 09:35:10 +0000 (12:35 +0300)
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Thu, 21 Apr 2011 12:44:21 +0000 (15:44 +0300)
The argument type of printf is __off64_t, meanwhile the classifier is "%ld".
We agreed to use PRIu64 in such case.

Signed-off-by: Andy Shevchenko <ext-andriy.shevchenko@nokia.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
serve_image.c

index f8f28a10184578215c903f26c4fa1293e4c1331a..d1037a96c19202470d228de686240a8d0e1c46d7 100644 (file)
@@ -2,7 +2,6 @@
 #define _POSIX_C_SOURCE 199309
 
 #include <time.h>
-
 #include <errno.h>     
 #include <error.h>     
 #include <netdb.h>     
@@ -18,6 +17,8 @@
 #include <netinet/in.h>
 #include <sys/time.h>
 #include <crc32.h>
+#include <inttypes.h>
+
 #include "mcast_image.h"
 
 int tx_rate = 80000;
@@ -126,8 +127,8 @@ int main(int argc, char **argv)
        }
 
        if (st.st_size % erasesize) {
-               fprintf(stderr, "Image size %ld bytes is not a multiple of erasesize %d bytes\n",
-                       st.st_size, erasesize);
+               fprintf(stderr, "Image size %" PRIu64 " bytes is not a multiple of erasesize %d bytes\n"
+                               st.st_size, erasesize);
                exit(1);
        }
        image = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, rfd, 0);