Always prepend file{addr,size} env variables values with 0x
authorPiotr Dymacz <pepe2k@gmail.com>
Fri, 16 Jun 2017 13:07:28 +0000 (15:07 +0200)
committerPiotr Dymacz <pepe2k@gmail.com>
Fri, 16 Jun 2017 17:31:48 +0000 (19:31 +0200)
u-boot/common/cmd_load.c
u-boot/net/net.c

index 71d3dd66baa403b0dde8da8054133cac727ac6c0..b8be6eebf25635ed23ca48d66278528053991e6e 100644 (file)
@@ -206,7 +206,7 @@ static ulong load_serial(ulong offset)
 
                        flush_cache(start_addr, size);
 
-                       sprintf(buf, "%lX", size);
+                       sprintf(buf, "0x%lX", size);
                        setenv("filesize", buf);
 
                        return addr;
@@ -516,7 +516,7 @@ int do_load_serial_bin(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 
                flush_cache(address, size_dl);
 
-               sprintf(buf, "%X", size_dl);
+               sprintf(buf, "0x%X", size_dl);
                setenv("filesize", buf);
        } else {
                puts("\n");
index 0ab249d3b92b98703a86215ad1b0fa4d5c6527c5..d35c765cad358daa71043c8c228386f8687fd71e 100644 (file)
@@ -515,10 +515,10 @@ int NetLoop(proto_t protocol){
                                        char buf[10];
                                        printf("\nBytes transferred: %ld (0x%lx)\n", NetBootFileXferSize, NetBootFileXferSize);
 
-                                       sprintf(buf, "%lx", NetBootFileXferSize);
+                                       sprintf(buf, "0x%lX", NetBootFileXferSize);
                                        setenv("filesize", buf);
 
-                                       sprintf(buf, "%lX", (unsigned long)load_addr);
+                                       sprintf(buf, "0x%lX", (unsigned long)load_addr);
                                        setenv("fileaddr", buf);
                                }