Public bug reported:

Binary package hint: manpages-fr

Hi, in the french "man 3 getopt" we can read as example :
...
main(int argc, char *argv[])
       {
           int flags, opt;
           int nsecs, tfnd;

           nsecs = 0;
           tfnd = 0;
           flags = 0;
           while ((opt = getopt(argc, argv, "nt:")) != -1) {
               switch (opt) {
               case ’n’:
                   flags = 1;
                   break;
               case ’t’:
                   nsecs = atoi(optarg);
                   tfnd = 1;
                   break;
               default: /* ’?’ */
                   fprintf(stderr, "Usage: %s [-t nsecs] [-n] name\n",
HERE ==>                        argv[1]);
                   exit(EXIT_FAILURE);
               }
           }
...

I think that argv[1] sould be argv[0], does i'm wrong ?

Regards,

Vincent Desmares

** Affects: manpages-fr (Ubuntu)
     Importance: Undecided
         Status: New

-- 
Error in example of getopt
https://bugs.launchpad.net/bugs/187171
You received this bug notification because you are a member of Ubuntu
Bugs, which is the bug contact for Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to