Patchwork [PATCHv1,2/5] serve_image: adjust type for printf

login
register
mail settings
Submitter Shevchenko Andriy (EXT-Teleca/Helsinki)
Date April 13, 2011, 1:20 p.m.
Message ID <865774bea767bf615bbaf79139448aef65d55202.1302700658.git.ext-andriy.shevchenko@nokia.com>
Download mbox | patch
Permalink /patch/91005/
State New
Headers show

Comments

Shevchenko Andriy (EXT-Teleca/Helsinki) - April 13, 2011, 1:20 p.m.
The argument type of printf is __off64_t, meanwhile the classificator is "%ld".

Signed-off-by: Andy Shevchenko <ext-andriy.shevchenko@nokia.com>
---
 serve_image.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Artem Bityutskiy - April 14, 2011, 12:25 p.m.
On Wed, 2011-04-13 at 16:20 +0300, Andy Shevchenko wrote:
>  	if (st.st_size % erasesize) {
>  		fprintf(stderr, "Image size %ld bytes is not a multiple of erasesize %d bytes\n",
> -			st.st_size, erasesize);
> +			(long)st.st_size, erasesize);

Same here.

Patch

diff --git a/serve_image.c b/serve_image.c
index f8f28a1..9eaf9dd 100644
--- a/serve_image.c
+++ b/serve_image.c
@@ -127,7 +127,7 @@  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);
+			(long)st.st_size, erasesize);
 		exit(1);
 	}
 	image = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, rfd, 0);