Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Disallow an empty suffix.
An empty suffix with forced compression would result in both the
original and compressed file being deleted.
  • Loading branch information
madler committed Dec 27, 2017
1 parent 9c1eaa1 commit 228c00c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pigz.c
Expand Up @@ -4263,8 +4263,11 @@ local int option(char *arg) {
throw(EINVAL, "compiled without threads");
#endif
}
else if (get == 3)
else if (get == 3) {
if (*arg == 0)
throw(EINVAL, "suffix cannot be empty");
g.sufx = arg; // gz suffix
}
#ifndef NOZOPFLI
else if (get == 4)
g.zopts.numiterations = (int)num(arg); // optimize iterations
Expand Down

0 comments on commit 228c00c

Please sign in to comment.