Skip to contentSkip to conversation

possible typo in `man 3 getopt`

DISCUSSION [email protected] 2 participants 2 messages Sep 8, 2020 Man-pages: manual pages for Linux -- Sections 2, 3, 4, 5, and 7

lore
Share & tools
lore
#0 lore raw

Think this is just a one char bug.

In the first example provided, the if statement checks for optind >= argc, which I believe should be < or maybe <=.
Thanks for the truly indespensable work.

#1 lore raw

Hello Michael,

Quoted 5 lines · On 9/8/20 12:03 PM, [email protected] wrote:

Think this is just a one char bug.

In the first example provided, the if statement checks for optind >= argc, which I believe should be < or maybe <=.
Thanks for the truly indespensable work.

The code looks okay to me. Why do you think it's wrong?

Thanks,

Michael

Signature · 3 lines
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/