Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: falcosecurity/falco
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 33e7c6f66aa0f3c00b6e9af734a8432519705c21
Choose a base ref
..
head repository: falcosecurity/falco
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 4f2babc623d096bde238f2f5335b3f215fa5c2a2
Choose a head ref
Showing with 4 additions and 4 deletions.
  1. +4 −4 userspace/falco/yaml_helper.h
8 changes: 4 additions & 4 deletions userspace/falco/yaml_helper.h
Original file line number Diff line number Diff line change
@@ -75,7 +75,7 @@ class yaml_helper
std::string value = node.as<std::string>();

// Helper function to convert string to the desired type T
auto convertStrToT = [&default_value](const std::string& str) -> T {
auto convert_str_to_t = [&default_value](const std::string& str) -> T {
std::stringstream ss(str);
T result;
if (ss >> result) return result;
@@ -89,9 +89,9 @@ class yaml_helper
if (value[2] == '{' && value[value.size() - 1] == '}')
{
value = value.substr(1);
return convertStrToT(value);
return convert_str_to_t(value);
}
else return convertStrToT(value);
else return convert_str_to_t(value);
}

// Check if the value is an environment variable reference
@@ -101,7 +101,7 @@ class yaml_helper
std::string env_var = value.substr(2, value.size() - 3);

const char* env_value = std::getenv(env_var.c_str()); // Get the environment variable value
if(env_value) return convertStrToT(env_value);
if(env_value) return convert_str_to_t(env_value);

return default_value;
}