projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[PATCH] Debug printf
[fio.git]
/
parse.c
diff --git
a/parse.c
b/parse.c
index 7a37868ac65df28bfbf7e124c0ff71892a90d32f..50d8ae5e5f4fe56ea12ba5ff33ca76fe48e114a4 100644
(file)
--- a/
parse.c
+++ b/
parse.c
@@
-154,6
+154,11
@@
static int __handle_option(struct fio_option *o, const char *ptr, void *data,
char **cp;
int ret = 0, is_time = 0;
char **cp;
int ret = 0, is_time = 0;
+ if (!ptr && o->type != FIO_OPT_STR_SET) {
+ fprintf(stderr, "Option %s requires an argument\n", o->name);
+ return 1;
+ }
+
switch (o->type) {
case FIO_OPT_STR: {
fio_opt_str_fn *fn = o->cb;
switch (o->type) {
case FIO_OPT_STR: {
fio_opt_str_fn *fn = o->cb;
@@
-271,7
+276,7
@@
static int __handle_option(struct fio_option *o, const char *ptr, void *data,
break;
}
default:
break;
}
default:
- fprintf(stderr, "Bad option type %
d
\n", o->type);
+ fprintf(stderr, "Bad option type %
u
\n", o->type);
ret = 1;
}
ret = 1;
}
@@
-280,7
+285,7
@@
static int __handle_option(struct fio_option *o, const char *ptr, void *data,
static int handle_option(struct fio_option *o, const char *ptr, void *data)
{
static int handle_option(struct fio_option *o, const char *ptr, void *data)
{
- const char *ptr2;
+ const char *ptr2
= NULL
;
int r1, r2;
/*
int r1, r2;
/*
@@
-288,7
+293,8
@@
static int handle_option(struct fio_option *o, const char *ptr, void *data)
* Do this before parsing the first round, to check if we should
* copy set 1 options to set 2.
*/
* Do this before parsing the first round, to check if we should
* copy set 1 options to set 2.
*/
- ptr2 = strchr(ptr, ',');
+ if (ptr)
+ ptr2 = strchr(ptr, ',');
/*
* Don't return early if parsing the first option fails - if
/*
* Don't return early if parsing the first option fails - if