common: Check option arguments for a valid range
authorWerner Koch <wk@gnupg.org>
Thu, 5 Mar 2015 01:33:47 +0000 (02:33 +0100)
committerWerner Koch <wk@gnupg.org>
Wed, 11 Mar 2015 14:02:30 +0000 (15:02 +0100)
commit25e2b27b0027af9c1ce0cae0cd549c09ed349811
treef3c2816c877793cc315f6fec247289b9cdecf686
parent2f3de06ff44daefae9857549fc4ab7ae8bf8e70d
common: Check option arguments for a valid range

* common/argparse.h (ARGPARSE_INVALID_ARG): New.
* common/argparse.c: Include limits h and errno.h.
(initialize): Add error strings for new error constant.
(set_opt_arg): Add range checking.
--
Signed-off-by: Werner Koch <wk@gnupg.org>
[ This is a backport of 0d73a242cb53522669cf712b5ece7d1ed05d003a from
  master to STABLE-BRANCH-2-0 ]

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
jnlib/argparse.c
jnlib/argparse.h