commit b87dbf9b556be8e2b6171baee6e4dd12782855c2
parent 63966f207ec9bd8c5b55845e94da9df2750dd653
Author: Morel BĂ©renger <berengermorel76@gmail.com>
Date: Wed, 12 Aug 2020 20:41:59 +0200
opt_parser.hpp: show<char*>() now escapes ctrl chars
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/btl/src/optparser.hpp b/btl/src/optparser.hpp
@@ -108,6 +108,8 @@ void print_opts( FILE_PTR target, opt_desc_t const* start, opt_desc_t const* end
#include <type_traits>
#include <limits>
+#include "utils.hpp"
+
// C "semi-static" strings in pointer
template <typename T>
bool set(
@@ -152,7 +154,7 @@ bool show(
fputs( "(current value: \"", target );
char const* current = *static_cast<char *const*>( val );
current = current ? current : "";
- fputs( current, target );
+ esc_fputs( current, target );
fputs( "\")", target );
return false;
}