engines/io_uring: Handle EINTR.
[fio.git] / parse.c
diff --git a/parse.c b/parse.c
index 84d112dceb9efc3d433e13b39693aee3de46a6e1..c4fd4626df9f581eb100894a8380d1fef61a0ca8 100644 (file)
--- a/parse.c
+++ b/parse.c
@@ -512,8 +512,11 @@ static bool val_too_large(const struct fio_option *o, unsigned long long val,
        if (!o->maxval)
                return false;
 
-       if (is_uint)
+       if (is_uint) {
+               if ((int) val < 0)
+                       return (int) val > (int) o->maxval;
                return (unsigned int) val > o->maxval;
+       }
 
        return val > o->maxval;
 }
@@ -599,8 +602,7 @@ static int __handle_option(const struct fio_option *o, const char *ptr,
                if (!is_time && o->is_time)
                        is_time = o->is_time;
 
-               tmp[sizeof(tmp) - 1] = '\0';
-               strncpy(tmp, ptr, sizeof(tmp) - 1);
+               snprintf(tmp, sizeof(tmp), "%s", ptr);
                p = strchr(tmp, ',');
                if (p)
                        *p = '\0';
@@ -826,8 +828,7 @@ static int __handle_option(const struct fio_option *o, const char *ptr,
                char tmp[128];
                char *p1, *p2;
 
-               tmp[sizeof(tmp) - 1] = '\0';
-               strncpy(tmp, ptr, sizeof(tmp) - 1);
+               snprintf(tmp, sizeof(tmp), "%s", ptr);
 
                /* Handle bsrange with separate read,write values: */
                p1 = strchr(tmp, ',');