sscanf fixup
authorBruce Cran <BCran@fusionio.com>
Thu, 5 May 2011 14:14:09 +0000 (08:14 -0600)
committerJens Axboe <jaxboe@fusionio.com>
Thu, 5 May 2011 14:14:09 +0000 (08:14 -0600)
I noticed that a job of:

[sequential write at  1k block size.]

Gets reported as "sequentia".

I think we need to use %255[^\n] in sscanf instead.

Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
init.c

diff --git a/init.c b/init.c
index aa31138c155b86f70315a375071e1a58c9d821f3..398dc20553e9c7f9ff2862436cdf6f3373a0900f 100644 (file)
--- a/init.c
+++ b/init.c
@@ -191,7 +191,7 @@ static void put_job(struct thread_data *td)
 {
        if (td == &def_thread)
                return;
-       
+
        profile_td_exit(td);
 
        if (td->error)
@@ -835,7 +835,7 @@ static int parse_jobs_ini(char *file, int stonewall_flag)
 
                if (is_empty_or_comment(p))
                        continue;
-               if (sscanf(p, "[%255s]", name) != 1) {
+               if (sscanf(p, "[%255[^\n]]", name) != 1) {
                        if (inside_skip)
                                continue;
                        log_err("fio: option <%s> outside of [] job section\n",