This causes the following behaviour:
$ ./prog -f 1 # OK $ ./prog -f -1 # ERROR
Note that getopt(3) handles both cases. Test program attached.
This isn't necessarily a general fix, but the attached patch resolves the issue for the common case.
Bug watches keep track of this bug in other bug trackers.
This isn't necessarily a general fix, but the attached patch resolves the issue for the common case.