projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Really fix broken option length check
[fio.git]
/
parse.c
diff --git
a/parse.c
b/parse.c
index e03592d8bd4ee0b7850e2067a847f4caae814f70..d8061610a8a92563c3701b02e8e7ee305f480ee5 100644
(file)
--- a/
parse.c
+++ b/
parse.c
@@
-278,6
+278,17
@@
static int check_int(const char *p, int *val)
return 1;
}
return 1;
}
+static int opt_len(const char *str)
+{
+ char *postfix;
+
+ postfix = strchr(str, ':');
+ if (!postfix)
+ return strlen(str);
+
+ return (int)(postfix - str);
+}
+
#define val_store(ptr, val, off, or, data) \
do { \
ptr = td_var((data), (off)); \
#define val_store(ptr, val, off, or, data) \
do { \
ptr = td_var((data), (off)); \
@@
-320,7
+331,7
@@
static int __handle_option(struct fio_option *o, const char *ptr, void *data,
if (!vp->ival || vp->ival[0] == '\0')
continue;
all_skipped = 0;
if (!vp->ival || vp->ival[0] == '\0')
continue;
all_skipped = 0;
- if (!strncmp(vp->ival, ptr,
str
len(ptr))) {
+ if (!strncmp(vp->ival, ptr,
opt_
len(ptr))) {
ret = 0;
if (o->roff1) {
if (vp->or)
ret = 0;
if (o->roff1) {
if (vp->or)