Merge branch 'master' of https://github.com/bvanassche/fio
[fio.git] / parse.c
diff --git a/parse.c b/parse.c
index a9486de9b7fbea40af8bf98237dcff15d1d0d69d..33fcf465ca5b9be90d670004604d6e51008ba27c 100644 (file)
--- a/parse.c
+++ b/parse.c
@@ -3,18 +3,16 @@
  */
 #include <stdio.h>
 #include <stdlib.h>
-#include <unistd.h>
 #include <ctype.h>
 #include <string.h>
 #include <errno.h>
 #include <limits.h>
-#include <stdlib.h>
-#include <math.h>
 #include <float.h>
 
 #include "compiler/compiler.h"
 #include "parse.h"
 #include "debug.h"
+#include "log.h"
 #include "options.h"
 #include "optgroup.h"
 #include "minmax.h"
@@ -172,7 +170,7 @@ static unsigned long long get_mult_time(const char *str, int len,
 
        c = strdup(p);
        for (i = 0; i < strlen(c); i++)
-               c[i] = tolower(c[i]);
+               c[i] = tolower((unsigned char)c[i]);
 
        if (!strncmp("us", c, 2) || !strncmp("usec", c, 4))
                mult = 1;
@@ -218,7 +216,7 @@ static unsigned long long __get_mult_bytes(const char *p, void *data,
        c = strdup(p);
 
        for (i = 0; i < strlen(c); i++) {
-               c[i] = tolower(c[i]);
+               c[i] = tolower((unsigned char)c[i]);
                if (is_separator(c[i])) {
                        c[i] = '\0';
                        break;
@@ -491,7 +489,7 @@ static const char *opt_type_name(struct fio_option *o)
        compiletime_assert(ARRAY_SIZE(opt_type_names) - 1 == FIO_OPT_UNSUPPORTED,
                                "opt_type_names[] index");
 
-       if (o->type >= 0 && o->type <= FIO_OPT_UNSUPPORTED)
+       if (o->type <= FIO_OPT_UNSUPPORTED)
                return opt_type_names[o->type];
 
        return "OPT_UNKNOWN?";