summaryrefslogtreecommitdiffstats
path: root/commands/loadb.c
diff options
context:
space:
mode:
Diffstat (limited to 'commands/loadb.c')
-rw-r--r--commands/loadb.c26
1 files changed, 4 insertions, 22 deletions
diff --git a/commands/loadb.c b/commands/loadb.c
index 37c272f6c7..140d3743f6 100644
--- a/commands/loadb.c
+++ b/commands/loadb.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+// SPDX-FileCopyrightText: © 2000-2004 Wolfgang Denk <wd@denx.de>, DENX Software Engineering
/**
* @file
* @brief LoadB and LoadY support.
@@ -7,24 +9,6 @@
*
* FileName: commands/loadb.c
*/
-/*
- * (C) Copyright 2000-2004
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- */
/*
* Serial up- and download support
@@ -558,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);
@@ -592,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);
@@ -664,7 +646,7 @@ static int do_load_serial_bin(int argc, char *argv[])
/* File should exist */
ofd = open_and_lseek(output_file, O_WRONLY | O_CREAT, offset);
if (ofd < 0) {
- perror(argv[0]);
+ printf("Could not open \"%s\": %m\n", output_file);
return 3;
}