Error in example of getopt

Bug #187171 reported by cold
2
Affects Status Importance Assigned to Milestone
manpages-fr (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

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

Revision history for this message
Daniel T Chen (crimsun) wrote :

Is this symptom still reproducible in 9.04?

Changed in manpages-fr:
status: New → Incomplete
Revision history for this message
Pedro Villavicencio (pedro) wrote :

We are closing this bug report because it lacks the information we need to investigate the problem, as described in the previous comments. Please reopen it if you can give us the missing information, and don't hesitate to submit bug reports in the future. To reopen the bug report you can click on the current status, under the Status column, and change the Status back to New. Thanks again!.

Changed in manpages-fr:
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.