diff options
author | Mirza, Taimoor <Taimoor_Mirza@mentor.com> | 2017-10-04 20:28:03 +0500 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2017-10-16 09:42:51 -0400 |
commit | a6e9810495bc929b6beafb88f557cdaadf87fc83 (patch) | |
tree | 200c810cd44c779e74cebb1c42d4d7b7f7fac01b /tools/fit_image.c | |
parent | 409f05f259ee5cb3e13b52279ce2365a6f8b8a8b (diff) |
tools/mkimage: Fix DTC run command to handle file names with space
fit_handle_file function does not quote input and output files while preparing
command to run DTC to convert .its to .itb. This results in a failure if input
or output files contain spaces in their names. Quote input and output files in
DTC command to avoid this failure.
Signed-off-by: Mirza, Taimoor <Taimoor_Mirza@mentor.com>
Diffstat (limited to 'tools/fit_image.c')
-rw-r--r-- | tools/fit_image.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/fit_image.c b/tools/fit_image.c index 30257b178e..6dcc88bae0 100644 --- a/tools/fit_image.c +++ b/tools/fit_image.c @@ -651,11 +651,11 @@ static int fit_handle_file(struct image_tool_params *params) *cmd = '\0'; } else if (params->datafile) { /* dtc -I dts -O dtb -p 500 datafile > tmpfile */ - snprintf(cmd, sizeof(cmd), "%s %s %s > %s", + snprintf(cmd, sizeof(cmd), "%s %s \"%s\" > \"%s\"", MKIMAGE_DTC, params->dtc, params->datafile, tmpfile); debug("Trying to execute \"%s\"\n", cmd); } else { - snprintf(cmd, sizeof(cmd), "cp %s %s", + snprintf(cmd, sizeof(cmd), "cp \"%s\" \"%s\"", params->imagefile, tmpfile); } if (*cmd && system(cmd) == -1) { |