static const char *opt_type_name(const struct fio_option *o)
{
- compiletime_assert(ARRAY_SIZE(opt_type_names) - 1 == FIO_OPT_UNSUPPORTED,
+ compiletime_assert(FIO_ARRAY_SIZE(opt_type_names) - 1 == FIO_OPT_UNSUPPORTED,
"opt_type_names[] index");
if (o->type <= FIO_OPT_UNSUPPORTED)
}
case FIO_OPT_STR_VAL_TIME:
is_time = 1;
- /* fall through */
+ fallthrough;
case FIO_OPT_ULL:
case FIO_OPT_INT:
case FIO_OPT_STR_VAL: {
if (o->off1) {
cp = td_var(data, o, o->off1);
*cp = strdup(ptr);
+ if (strlen(ptr) > o->maxlen - 1) {
+ log_err("value exceeds max length of %d\n",
+ o->maxlen);
+ return 1;
+ }
}
if (fn)
}
case FIO_OPT_DEPRECATED:
ret = 1;
- /* fall through */
+ fallthrough;
case FIO_OPT_SOFT_DEPRECATED:
log_info("Option %s is deprecated\n", o->name);
break;