Commit cf4af9aa authored by Kristofer Pettersson's avatar Kristofer Pettersson

Automerge

parents 667338df 0c7e8fdd
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include <mysys_err.h> #include <mysys_err.h>
#include <my_getopt.h> #include <my_getopt.h>
#include <errno.h> #include <errno.h>
#include <m_string.h>
typedef void (*init_func_p)(const struct my_option *option, uchar* *variable, typedef void (*init_func_p)(const struct my_option *option, uchar* *variable,
longlong value); longlong value);
...@@ -649,8 +650,18 @@ static int setval(const struct my_option *opts, uchar* *value, char *argument, ...@@ -649,8 +650,18 @@ static int setval(const struct my_option *opts, uchar* *value, char *argument,
return EXIT_OUT_OF_MEMORY; return EXIT_OUT_OF_MEMORY;
break; break;
case GET_ENUM: case GET_ENUM:
if (((*(int*)result_pos)= find_type(argument, opts->typelib, 2) - 1) < 0) if (((*(int*)result_pos)=
return EXIT_ARGUMENT_INVALID; find_type(argument, opts->typelib, 2) - 1) < 0)
{
/*
Accept an integer representation of the enumerated item.
*/
char *endptr;
unsigned int arg= (unsigned int) strtol(argument, &endptr, 10);
if (*endptr || arg >= opts->typelib->count)
return EXIT_ARGUMENT_INVALID;
*(int*)result_pos= arg;
}
break; break;
case GET_SET: case GET_SET:
*((ulonglong*)result_pos)= find_typeset(argument, opts->typelib, &err); *((ulonglong*)result_pos)= find_typeset(argument, opts->typelib, &err);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment