From: Jens Axboe Date: Tue, 7 Nov 2006 13:29:17 +0000 (+0100) Subject: [PATCH] Fix options with no parameters X-Git-Tag: fio-1.9~1 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=92b586f8ec428c23a88eea838afadc00331d4bb4;p=fio.git [PATCH] Fix options with no parameters Got broken yesterday, with the addition of the comma separated entries. Signed-off-by: Jens Axboe --- diff --git a/parse.c b/parse.c index 7a37868a..869b3dbf 100644 --- a/parse.c +++ b/parse.c @@ -280,7 +280,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) { - const char *ptr2; + const char *ptr2 = NULL; int r1, r2; /* @@ -288,7 +288,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. */ - ptr2 = strchr(ptr, ','); + if (ptr) + ptr2 = strchr(ptr, ','); /* * Don't return early if parsing the first option fails - if