]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - tools/fit_image.c
tools/mkimage: Fix DTC run command to handle file names with space
[people/ms/u-boot.git] / tools / fit_image.c
index 30257b178e274b0024c2a775d03dc9e6d5ba9fa1..6dcc88bae00f7f149ed741b84ed5d8812ce61c1a 100644 (file)
@@ -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) {