*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) {