Skip to content

Commit

Permalink
fix(userspace/libsinsp): support comparisons with double fields
Browse files Browse the repository at this point in the history
Signed-off-by: Jason Dellaluce <[email protected]>
  • Loading branch information
jasondellaluce authored and poiana committed May 16, 2024
1 parent a82cc16 commit 8ebd6ee
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions userspace/libsinsp/value_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,17 @@ size_t sinsp_filter_value_parser::string_to_rawval(const char* str, uint32_t len
}

break;
case PT_DOUBLE:
{
check_storage_size(str, max_len, sizeof(double));
// note(jasondellaluce): we historically never supported parsing
// floating point number values, so as a starter we just stick to
// integer numberd
// todo(jasondellaluce): support floating point (double) value parsing
*(double*)storage = (double)sinsp_numparser::parsed32(str);
parsed_len = sizeof(double);
break;
}
case PT_IPADDR:
if(memchr(str, '.', len) != NULL)
{
Expand Down

0 comments on commit 8ebd6ee

Please sign in to comment.