plugins: use stricter parsing for option values

also: convert the stored int value from 'int' to 's64'

atoi fails silently, returning a zero. instead we use the more robust
strtoll which will allow us fail with an error.

we also make the parsing for bools stricter, only allowing plausibly
boolean values to parse.
This commit is contained in:
lisa neigut
2020-03-07 18:13:12 -06:00
committed by Rusty Russell
parent d19cddf00f
commit cac5a0cd1d
2 changed files with 36 additions and 12 deletions

View File

@@ -114,7 +114,7 @@ struct plugins {
*/
struct plugin_opt_value {
char *as_str;
int *as_int;
s64 *as_int;
bool *as_bool;
};