From 0d73a242cb53522669cf712b5ece7d1ed05d003a Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Wed, 29 Oct 2014 17:07:51 +0100 Subject: 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 --- common/argparse.h | 1 + 1 file changed, 1 insertion(+) (limited to 'common/argparse.h') diff --git a/common/argparse.h b/common/argparse.h index 29c7b6252..471cf7479 100644 --- a/common/argparse.h +++ b/common/argparse.h @@ -190,6 +190,7 @@ typedef struct #define ARGPARSE_AMBIGUOUS_COMMAND (-9) #define ARGPARSE_INVALID_ALIAS (-10) #define ARGPARSE_OUT_OF_CORE (-11) +#define ARGPARSE_INVALID_ARG (-12) int arg_parse( ARGPARSE_ARGS *arg, ARGPARSE_OPTS *opts); -- cgit v1.2.3