help-gengetopt
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [help-gengetopt] Input validation


From: Michael Hagemann
Subject: Re: [help-gengetopt] Input validation
Date: Thu, 22 Dec 2005 19:57:33 +0100
User-agent: Thunderbird 1.4.1 (X11/20051006)

Lorenzo Bettini wrote:
Michael Hagemann wrote:

Maybe I can look into this next week, if nobody else is faster... ;-)

have I been faster? ;-)

oooh yes, you have! ;-)

I've put up a fix using Ben's template:

http://rap.dsi.unifi.it/~bettini/gengetopt-2.15rc1.tar.gz

now the generated code for a numeric option is as follows:

args_info->int_arg = strtol (optarg, &stop_char, 0);
if (!(stop_char && *stop_char == '\0')) {
  fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg);
  goto failure;
}

and this should do, shouldn't it?

Looks good to me.  Will test it next week...


regards,
michael





reply via email to

[Prev in Thread] Current Thread [Next in Thread]