Commit 228c00cc authored by Mark Adler's avatar Mark Adler

Disallow an empty suffix.

An empty suffix with forced compression would result in both the
original and compressed file being deleted.
parent 9c1eaa17
......@@ -4263,8 +4263,11 @@ local int option(char *arg) {
throw(EINVAL, "compiled without threads");
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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment