diff mbox

[U-Boot,1/3] cmd_nvedit: use explicit typecast for printf

Message ID 1297260631-13864-2-git-send-email-biessmann@corscience.de
State Accepted, archived
Headers show

Commit Message

Andreas Bießmann Feb. 9, 2011, 2:10 p.m. UTC
This patch fixes warnings in MAKEALL for avr32:

---8<---
cmd_nvedit.c: In function 'do_env_export':
cmd_nvedit.c:663: warning: format '%zX' expects type 'size_t', but argument 3 has type 'ssize_t'
--->8---

Signed-off-by: Andreas Bießmann <biessmann@corscience.de>
---
 common/cmd_nvedit.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Comments

Wolfgang Denk April 12, 2011, 7:44 p.m. UTC | #1
Dear =?UTF-8?q?Andreas=20Bie=C3=9Fmann?=,

In message <1297260631-13864-2-git-send-email-biessmann@corscience.de> you wrote:
> This patch fixes warnings in MAKEALL for avr32:
> 
> ---8<---
> cmd_nvedit.c: In function 'do_env_export':
> cmd_nvedit.c:663: warning: format '%zX' expects type 'size_t', but argument 3 has type 'ssize_t'
> --->8---
> 
> Signed-off-by: Andreas Bießmann <biessmann@corscience.de>
> ---
>  common/cmd_nvedit.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk
diff mbox

Patch

diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c
index fb69c24..6d8512a 100644
--- a/common/cmd_nvedit.c
+++ b/common/cmd_nvedit.c
@@ -659,7 +659,7 @@  static int do_env_export(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv
 				errno);
 			return 1;
 		}
-		sprintf(buf, "%zX", len);
+		sprintf(buf, "%zX", (size_t)len);
 		setenv("filesize", buf);
 
 		return 0;
@@ -685,7 +685,7 @@  static int do_env_export(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv
 		envp->flags = ACTIVE_FLAG;
 #endif
 	}
-	sprintf(buf, "%zX", len + offsetof(env_t,data));
+	sprintf(buf, "%zX", (size_t)(len + offsetof(env_t,data)));
 	setenv("filesize", buf);
 
 	return 0;