From f1478851ee3b8581215e5a017a51f3352bb874bf Mon Sep 17 00:00:00 2001 From: Alexis Hildebrandt Date: Tue, 23 Dec 2014 23:45:39 +0100 Subject: Fix crash when using --trace 10 or above uint8_t is typedef'd to char, thus boost::lexical_cast treats it as such instead of a number. --- src/global.cc | 2 +- src/utils.cc | 2 +- src/utils.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/global.cc b/src/global.cc index a58bba54..e5a2f809 100644 --- a/src/global.cc +++ b/src/global.cc @@ -514,7 +514,7 @@ void handle_debug_options(int argc, char * argv[]) #if TRACING_ON _log_level = LOG_TRACE; try { - _trace_level = boost::lexical_cast(argv[i + 1]); + _trace_level = boost::lexical_cast(argv[i + 1]); } catch (const boost::bad_lexical_cast&) { throw std::logic_error(_("Argument to --trace must be an integer")); diff --git a/src/utils.cc b/src/utils.cc index 741ce79d..7b7c468c 100644 --- a/src/utils.cc +++ b/src/utils.cc @@ -574,7 +574,7 @@ std::ostream * _log_stream = &std::cerr; std::ostringstream _log_buffer; #if TRACING_ON -uint8_t _trace_level; +uint16_t _trace_level; #endif static bool logger_has_run = false; diff --git a/src/utils.h b/src/utils.h index c3dcf562..95c87929 100644 --- a/src/utils.h +++ b/src/utils.h @@ -251,7 +251,7 @@ void logger_func(log_level_t level); #if TRACING_ON -extern uint8_t _trace_level; +extern uint16_t _trace_level; #define SHOW_TRACE(lvl) \ (ledger::_log_level >= ledger::LOG_TRACE && lvl <= ledger::_trace_level) -- cgit v1.2.3