From: Daniel Glanzmann Date: Mon, 29 Sep 2008 18:12:30 +0000 (+0200) Subject: fixed check for empty string in installer X-Git-Tag: v2.3-beta4~14^2~7 X-Git-Url: http://git.ipfire.org/?p=people%2Fpmueller%2Fipfire-2.x.git;a=commitdiff_plain;h=7062cecd72cdd21a54cbba784bfb188e55835248 fixed check for empty string in installer --- 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; } }