Closed umarcor closed 3 years ago
Adding {NULL, 0, NULL, 0}, as the last long option avoids crashes when non-supported long options are provided.
{NULL, 0, NULL, 0},
Without this patch:
# ./icesprog.exe --version Segmentation fault
With this patch:
# ./icesprog.exe --version icesprog.exe: unknown option -- version usage: icesprog.exe [OPTION] [FILE] -w | --write write spi-flash -r | --read read spi-flash -e | --erase erase spi-flash -p | --probe probe spi-flash -o | --offset spi-flash offset -l | --len len of write/read -h | --help display help info -- version 1.0 --
Adding
{NULL, 0, NULL, 0},
as the last long option avoids crashes when non-supported long options are provided.Without this patch:
With this patch: