From: Ulrich Drepper Date: Mon, 6 Oct 2003 21:20:39 +0000 (+0000) Subject: Fix warnings. Better error message for missing -c argument. X-Git-Tag: cvs/glibc-2_3_3~130 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b7129dfbc1f5cea432e97dbe6e1556581af9682e;p=thirdparty%2Fglibc.git Fix warnings. Better error message for missing -c argument. --- diff --git a/manual/examples/testopt.c b/manual/examples/testopt.c index 94baf4db553..44ca8e4ad0a 100644 --- a/manual/examples/testopt.c +++ b/manual/examples/testopt.c @@ -1,8 +1,10 @@ /*@group*/ -#include +#include #include +#include +#include -int +int main (int argc, char **argv) { int aflag = 0; @@ -28,7 +30,9 @@ main (int argc, char **argv) cvalue = optarg; break; case '?': - if (isprint (optopt)) + if (optopt == 'c') + fprintf (stderr, "Option -%c requires an argument.\n", optopt); + else if (isprint (optopt)) fprintf (stderr, "Unknown option `-%c'.\n", optopt); else fprintf (stderr,