given
ARGPARSE_OPTION(INT, 'n', "--number", &opt_n, "int nr"),
running the following will "successfully" result in opt_n=0
./prg -n WTF
./prg -n " "
./prg -n \?
same issue for FLOAT
cause: YOLO-style use of strtol / strtof:
in update_value:
res = string ? strtol(value, NULL, 0) : *(int *)value;
and
*(float *)arg->value_ = string ? strtof(value, NULL) : *(float *)value;
see strtol(3) and strtod(3) on why
given
running the following will "successfully" result in opt_n=0
same issue for FLOAT
cause: YOLO-style use of strtol / strtof:
in update_value:
and
see
strtol(3)andstrtod(3)on why