Skip to content

Commit

Permalink
config: Decrease float string length estimation.
Browse files Browse the repository at this point in the history
  • Loading branch information
rtrbt committed Mar 22, 2022
1 parent bb18805 commit 2139d01
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion software/src/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,8 @@ struct string_length_visitor {
return x.maxChars + 2; // ""
}
size_t operator()(const Config::ConfFloat &x) {
return 42; // Educated guess
// Educated guess, FLT_MAX is ~3*10^38 however it is unlikely that a user will send enough float values longer than 20.
return 20;
}
size_t operator()(const Config::ConfInt &x) {
return 11;
Expand Down

0 comments on commit 2139d01

Please sign in to comment.