Fixed some compiler warnings

This commit is contained in:
Michiel Broek 2008-11-26 21:40:54 +00:00
parent 07c23fd9a7
commit 0d36c7a53e

View File

@ -4,7 +4,7 @@
* Purpose ...............: ReArc an archive. * Purpose ...............: ReArc an archive.
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2005 * Copyright (C) 1997-2008
* *
* Michiel Broek FIDO: 2:280/2802 * Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10 * Beekmansbos 10
@ -75,8 +75,7 @@ int rearc(char *filename, char *arctype, int do_quiet)
return -1; return -1;
} }
uncmd = xstrcpy(archiver.funarc); if (strlen(archiver.funarc) == 0) {
if ((uncmd == NULL) || (uncmd == "")) {
if (!do_quiet) { if (!do_quiet) {
mbse_colour(LIGHTRED, BLACK); mbse_colour(LIGHTRED, BLACK);
printf(" no unarchive command available\n"); printf(" no unarchive command available\n");
@ -84,6 +83,7 @@ int rearc(char *filename, char *arctype, int do_quiet)
Syslog('+', "rearc(%s, %s), no unarchive command available", filename, arctype); Syslog('+', "rearc(%s, %s), no unarchive command available", filename, arctype);
return -1; return -1;
} }
uncmd = xstrcpy(archiver.funarc);
newname = calloc(PATH_MAX, sizeof(char)); newname = calloc(PATH_MAX, sizeof(char));
strcpy(newname, filename); strcpy(newname, filename);
@ -116,8 +116,7 @@ int rearc(char *filename, char *arctype, int do_quiet)
snprintf(p, 6, "%s", archiver.name); snprintf(p, 6, "%s", archiver.name);
Syslog('f', "new filename %s", newname); Syslog('f', "new filename %s", newname);
arccmd = xstrcpy(archiver.farc); if (strlen(archiver.farc) == 0) {
if ((arccmd == NULL) || (arccmd == "")) {
if (!do_quiet) { if (!do_quiet) {
mbse_colour(LIGHTRED, BLACK); mbse_colour(LIGHTRED, BLACK);
printf(" no archive command available\n"); printf(" no archive command available\n");
@ -127,6 +126,7 @@ int rearc(char *filename, char *arctype, int do_quiet)
free(newname); free(newname);
return -1; return -1;
} }
arccmd = xstrcpy(archiver.farc);
/* /*
* unarchive and archive commands are available, create a temp directory to work in. * unarchive and archive commands are available, create a temp directory to work in.