Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

[libubootenv][PATCH] src/uboot_env.c: Increase line length

10 views
Skip to first unread message

Leon Anavi

unread,
Jul 5, 2024, 4:51:53 AM7/5/24
to swup...@googlegroups.com, Leon Anavi
Increase LINE_LENGTH from 1024 to 2048 because nowadays for some
boards U-Boot CONFIG_SYS_CBSIZE (and CONFIG_SYS_PBSIZE respectively)
is greater than 1024. This leads to truncating longer lines which
can be fatal in specific cases, for example with a long bootcmd.

Signed-off-by: Leon Anavi <leon....@konsulko.com>
---
src/uboot_env.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/uboot_env.c b/src/uboot_env.c
index 5c0865c..50ba87d 100644
--- a/src/uboot_env.c
+++ b/src/uboot_env.c
@@ -1409,7 +1409,7 @@ cleanup:
return status;
}

-#define LINE_LENGTH 1024
+#define LINE_LENGTH 2048
int libuboot_load_file(struct uboot_ctx *ctx, const char *filename)
{
FILE *fp;
--
2.39.2

Stefano Babic

unread,
Jul 5, 2024, 5:08:57 AM7/5/24
to Leon Anavi, swup...@googlegroups.com
Hi Leon,

On 05.07.24 10:43, Leon Anavi wrote:
> Increase LINE_LENGTH from 1024 to 2048 because nowadays for some
> boards U-Boot CONFIG_SYS_CBSIZE (and CONFIG_SYS_PBSIZE respectively)
> is greater than 1024. This leads to truncating longer lines which
> can be fatal in specific cases, for example with a long bootcmd.
>

Once was 1024 in U-Boot a huge value....

> Signed-off-by: Leon Anavi <leon....@konsulko.com>
> ---
> src/uboot_env.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/uboot_env.c b/src/uboot_env.c
> index 5c0865c..50ba87d 100644
> --- a/src/uboot_env.c
> +++ b/src/uboot_env.c
> @@ -1409,7 +1409,7 @@ cleanup:
> return status;
> }
>
> -#define LINE_LENGTH 1024
> +#define LINE_LENGTH 2048
> int libuboot_load_file(struct uboot_ctx *ctx, const char *filename)
> {
> FILE *fp;

Acked-by: Stefano Babic <stefan...@swupdate.org>

Best regards,
Stefano Babic
Reply all
Reply to author
Forward
0 new messages