return false;
if (is_uint) {
- unsigned int uint_val = val;
-
- return uint_val > o->maxval;
+ if ((int) val < 0)
+ return (int) val > (int) o->maxval;
+ return (unsigned int) val > o->maxval;
}
return val > o->maxval;
if (!o->minval)
return false;
- if (is_uint) {
- unsigned int uint_val = val;
-
- return uint_val < o->minval;
- }
+ if (is_uint)
+ return (int) val < o->minval;
return val < o->minval;
}
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';
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, ',');