summaryrefslogtreecommitdiffstats
path: root/commands/loadb.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2022-06-17 10:04:34 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2022-06-21 12:33:33 +0200
commit58c7c027acc4ebf27ddd622001bafb596e8123cf (patch)
tree311129752324cecd955853de25f2f96034e48a96 /commands/loadb.c
parentecd082ad21a1d07973f42adbd5f2a20a07fdc71f (diff)
downloadbarebox-58c7c027acc4ebf27ddd622001bafb596e8123cf.tar.gz
barebox-58c7c027acc4ebf27ddd622001bafb596e8123cf.tar.xz
treewide: Use pr_setenv() where appropriate
We now have pr_setenv() which is a setenv() variant that takes a format string. Use it where appropriate. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'commands/loadb.c')
-rw-r--r--commands/loadb.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/commands/loadb.c b/commands/loadb.c
index 17d3af84b5..7ab989f459 100644
--- a/commands/loadb.c
+++ b/commands/loadb.c
@@ -542,7 +542,6 @@ packet_error:
static ulong load_serial_bin(void)
{
int size, i;
- char buf[32];
/* Try to allocate the buffer we shall write to files */
write_buffer = malloc(MAX_WRITE_BUFFER);
@@ -576,8 +575,7 @@ static ulong load_serial_bin(void)
write_idx = 0;
}
printf("## Total Size = 0x%08x = %d Bytes\n", size, size);
- sprintf(buf, "%X", size);
- setenv("filesize", buf);
+ pr_setenv("filesize", "%X", size);
err_quit:
free(write_buffer);