autoupdater: avoid additional shell process

This commit is contained in:
Christian 2021-08-26 00:41:43 +02:00
parent d3bc159bf8
commit 03bfd9f779
1 changed files with 4 additions and 2 deletions

View File

@ -380,10 +380,12 @@ static bool autoupdate(const char *mirror, struct settings *s, int lock_fd) {
/* Test the image upgrade (issue #193) */
{
static const char *const exec_builtin = "exec ";
static const char *const test_option = " --test ";
char buf[strlen(sysupgrade_path) + strlen(test_option) + strlen(firmware_path) + 1];
strcpy(buf, sysupgrade_path);
char buf[strlen(exec_builtin) + strlen(sysupgrade_path) + strlen(test_option) + strlen(firmware_path) + 1];
strcpy(buf, exec_builtin);
strcat(buf, sysupgrade_path);
strcat(buf, test_option);
strcat(buf, firmware_path);