/** xt_size **/
-struct unit_definition xtype_units_size[] = {
+static struct unit_definition xtype_units_size[] = {
[SIZE_UNIT_BYTE] = { "", 1LLU, 1 },
[SIZE_UNIT_KILOBYTE] = { "KB", 1024LLU, 1 },
[SIZE_UNIT_MEGABYTE] = { "MB", 1024LLU * 1024LLU, 1 },
{
errno = 0;
char *units_start = NULL;
- u64 parsed = strtol(str, &units_start, 10);
+ u64 parsed = strtoul(str, &units_start, 10);
if(str == units_start) {
return mp_printf(pool, "Invalid value of size: '%s'.", str);
}
int unit_idx = xtype_unit_parser(units_start, xtype_units_size);
if(unit_idx == -1) {
- return mp_printf(pool, "Invalid format of size: '%s'.", str);
+ return mp_printf(pool, "Invalid units: '%s'.", units_start);
}
*(u64*) dest = parsed * xtype_units_size[unit_idx].num;
{
errno = 0;
char *parse_end = NULL;
- u64 parsed = strtol(str, &parse_end, 10);
+ u64 parsed = strtoul(str, &parse_end, 10);
if(str == parse_end) {
return mp_printf(pool, "Invalid value of timestamp: '%s'.", str);
}