From 7062cecd72cdd21a54cbba784bfb188e55835248 Mon Sep 17 00:00:00 2001 From: Daniel Glanzmann Date: Mon, 29 Sep 2008 20:12:30 +0200 Subject: [PATCH] fixed check for empty string in installer --- src/install+setup/install/main.c | 2 +- src/install+setup/install/unattended.c | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/install+setup/install/main.c b/src/install+setup/install/main.c index bf8f5b2bd7..52b0402984 100644 --- a/src/install+setup/install/main.c +++ b/src/install+setup/install/main.c @@ -541,7 +541,7 @@ int main(int argc, char *argv[]) } /* Copy restore file from cdrom */ - if (unattended && !strcmp(restore_file, "")) { + if (unattended && (strlen(restore_file) > 0)) { fprintf(flog, "unattended: Copy restore file\n"); snprintf(commandstring, STRING_SIZE, "cp /cdrom/%s /harddisk/var/ipfire/backup", restore_file); diff --git a/src/install+setup/install/unattended.c b/src/install+setup/install/unattended.c index 8dc4882a31..5bec24f0e2 100644 --- a/src/install+setup/install/unattended.c +++ b/src/install+setup/install/unattended.c @@ -147,13 +147,12 @@ int unattended_setup(struct keyvalue *unattendedkv) { } /* restore backup */ - if (!strcmp(restore_file, "")) { + if (strlen(restore_file) > 0) { fprintf(flog, "unattended: Restoring Backup\n"); snprintf(commandstring, STRING_SIZE, "cd /harddisk && /bin/tar -xvz --preserve -f /harddisk/var/ipfire/%s", restore_file); if (mysystem(commandstring)) { errorbox("unattended: ERROR restoring backup"); - return 0; } } -- 2.39.2