Skip to content

Commit

Permalink
Fix parsing compression option to work for all possible options
Browse files Browse the repository at this point in the history
  • Loading branch information
phaag committed May 21, 2023
1 parent 12a90b4 commit 7413188
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/lib/nffile.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,12 @@ int ParseCompression(char *arg) {
if (arg == NULL) {
return LZO_COMPRESSED;
}
if (arg[0] != '=' || strlen(arg) > 16) {

if (arg[0] == '=') arg++;

if (strlen(arg) > 16) {
return -1;
}
arg++;

for (int i = 0; arg[i]; i++) {
arg[i] = tolower(arg[i]);
Expand Down

0 comments on commit 7413188

Please sign in to comment.