Avoid double-declaration of ARRAY_SIZE
[fio.git] / parse.c
diff --git a/parse.c b/parse.c
index 079f19e3d32754f53ebfb3d9ca0ff5a8c707fc15..188f72826185d2a1c3dba8f48bca01ccfa2a1e56 100644 (file)
--- a/parse.c
+++ b/parse.c
@@ -608,6 +608,9 @@ static int __handle_option(struct fio_option *o, const char *ptr, void *data,
        case FIO_OPT_STR_STORE: {
                fio_opt_str_fn *fn = o->cb;
 
+               if (!strlen(ptr))
+                       return 1;
+
                if (o->off1) {
                        cp = td_var(data, o, o->off1);
                        *cp = strdup(ptr);
@@ -621,7 +624,7 @@ static int __handle_option(struct fio_option *o, const char *ptr, void *data,
                        ret = 1;
                        for (i = 0; i < PARSE_MAX_VP; i++) {
                                vp = &posval[i];
-                               if (!vp->ival || vp->ival[0] == '\0')
+                               if (!vp->ival || vp->ival[0] == '\0' || !cp)
                                        continue;
                                all_skipped = 0;
                                if (!strncmp(vp->ival, ptr, str_match_len(vp, ptr))) {