/** 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 },
return mp_printf(pool, "%"PRIu64"%s", curr_val, xtype_units_size[out_units].unit);
}
-static const char * xt_size_fmt_parse(const char *opt_str, u32 *dest, struct mempool *pool)
+static const char *xt_size_fmt_parse(const char *opt_str, u32 *dest, struct mempool *pool)
{
if(opt_str == NULL) {
return "NULL is not supported as a column argument.";
{
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;
return mp_printf(pool, "%s", formatted_time_buf);
}
-static const char * xt_timestamp_fmt_parse(const char *opt_str, u32 *dest, struct mempool *pool)
+static const char *xt_timestamp_fmt_parse(const char *opt_str, u32 *dest, struct mempool *pool)
{
if(opt_str == NULL) {
return "NULL is not supported as a column argument.";
{
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);
}