Merge pull request #6 from lhearachel/patch-2

Patch -palIndex option check
This commit is contained in:
Akira Akashi 2024-01-31 00:40:25 +00:00 committed by GitHub
commit 492688b25c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

2
main.c
View File

@ -288,7 +288,7 @@ void HandleNtrToPngCommand(char *inputPath, char *outputPath, int argc, char **a
if (!ParseNumber(argv[i], NULL, 10, &options.palIndex))
FATAL_ERROR("Failed to parse palette index.\n");
if (options.width < 1)
if (options.palIndex < 1)
FATAL_ERROR("Palette index must be positive.\n");
}
else if (strcmp(option, "-width") == 0)