From: Sven Roederer Date: Mon, 27 Apr 2020 00:08:39 +0000 (+0200) Subject: tools/fit-image: print a warning when cmd-line for dtc might be truncated X-Git-Tag: v2025.01-rc5-pxa1908~2435^2~11 X-Git-Url: http://git.dujemihanovic.xyz/img/%7B%7B%20%24image.RelPermalink%20%7D%7D?a=commitdiff_plain;h=ea5d3731b843b14f1c48d0d0f2c7d2877ecbf673;p=u-boot.git tools/fit-image: print a warning when cmd-line for dtc might be truncated Signed-off-by: Sven Roederer --- diff --git a/tools/fit_image.c b/tools/fit_image.c index 4aeabbcfe9..88ff093d05 100644 --- a/tools/fit_image.c +++ b/tools/fit_image.c @@ -17,6 +17,7 @@ #include "fit_common.h" #include "mkimage.h" #include +#include #include #include #include @@ -744,6 +745,9 @@ static int fit_handle_file(struct image_tool_params *params) snprintf(cmd, sizeof(cmd), "cp \"%s\" \"%s\"", params->imagefile, tmpfile); } + if (strlen(cmd) >= MKIMAGE_MAX_DTC_CMDLINE_LEN - 1) { + fprintf(stderr, "WARNING: command-line for FIT creation might be truncated and will probably fail.\n"); + } if (*cmd && system(cmd) == -1) { fprintf (stderr, "%s: system(%s) failed: %s\n",