summaryrefslogtreecommitdiff
path: root/src/output.cc
diff options
context:
space:
mode:
authorTim Landscheidt <tim@tim-landscheidt.de>2019-01-14 18:34:20 +0000
committerTim Landscheidt <tim@tim-landscheidt.de>2019-01-14 18:34:56 +0000
commit2ef1fbd738577a2ea1eb332d4a777ec659366b7d (patch)
tree3881025161ed1198e4356511d745773236db6be7 /src/output.cc
parent40f0bbfbb75296cc42e9fd44ac168048469176f2 (diff)
downloadfork-ledger-2ef1fbd738577a2ea1eb332d4a777ec659366b7d.tar.gz
fork-ledger-2ef1fbd738577a2ea1eb332d4a777ec659366b7d.tar.bz2
fork-ledger-2ef1fbd738577a2ea1eb332d4a777ec659366b7d.zip
Fix warning about uninitialized variable prepend_width
Diffstat (limited to 'src/output.cc')
-rw-r--r--src/output.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/output.cc b/src/output.cc
index c2fa83ac..09d3ad9e 100644
--- a/src/output.cc
+++ b/src/output.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2018, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2019, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -284,8 +284,9 @@ void report_accounts::flush()
std::ostream& out(report.output_stream);
format_t prepend_format;
std::size_t prepend_width;
+ bool do_prepend_format;
- if (report.HANDLED(prepend_format_)) {
+ if ((do_prepend_format = report.HANDLED(prepend_format_))) {
prepend_format.parse_format(report.HANDLER(prepend_format_).str());
prepend_width = report.HANDLED(prepend_width_)
? lexical_cast<std::size_t>(report.HANDLER(prepend_width_).str())
@@ -293,7 +294,7 @@ void report_accounts::flush()
}
foreach (accounts_pair& entry, accounts) {
- if (prepend_format) {
+ if (do_prepend_format) {
bind_scope_t bound_scope(report, *entry.first);
out.width(static_cast<std::streamsize>(prepend_width));
out << prepend_format(bound_scope);