[PATCH] Improve time accounting for a job
[fio.git] / init.c
diff --git a/init.c b/init.c
index 00f957651bc1ae65164c476665d73f863d1787ee..36c1839b18767ef3910a44f4fb56333f2562e2c5 100644 (file)
--- a/init.c
+++ b/init.c
@@ -516,16 +516,16 @@ static void fixup_options(struct thread_data *td)
 static char *to_kmg(unsigned int val)
 {
        char *buf = malloc(32);
-       char post[] = { 0, 'K', 'M', 'G', 'P', -1 };
+       char post[] = { 0, 'K', 'M', 'G', 'P', 0 };
        char *p = post;
 
-       while (*p != -1) {
+       do {
                if (val & 1023)
                        break;
 
                val >>= 10;
                p++;
-       }
+       } while (*p);
 
        snprintf(buf, 31, "%u%c", val, *p);
        return buf;
@@ -848,7 +848,7 @@ static int str_ioengine_cb(void *data, const char *str)
        if (td->io_ops)
                return 0;
 
-       log_err("fio: ioengine: { linuxaio, aio, libaio }, posixaio, sync, mmap, sgio, splice, cpu\n");
+       log_err("fio: ioengine= libaio, posixaio, sync, mmap, sgio, splice, cpu, null\n");
        log_err("fio: or specify path to dynamic ioengine module\n");
        return 1;
 }