summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2010-01-21 04:57:15 -0500
committerJohn Wiegley <johnw@newartisans.com>2010-01-21 04:57:15 -0500
commitd406aeb85d837bacb4e6e764794ca91a016a8361 (patch)
tree2ed02165e140941b2ebf8a9f3aaa6ad23cdc6d8d /src
parent61edd3d8f4c7d5a9d8cabfb9391a7e9f20a95446 (diff)
downloadfork-ledger-d406aeb85d837bacb4e6e764794ca91a016a8361.tar.gz
fork-ledger-d406aeb85d837bacb4e6e764794ca91a016a8361.tar.bz2
fork-ledger-d406aeb85d837bacb4e6e764794ca91a016a8361.zip
Guard against divide by zero error in -A reg report
Diffstat (limited to 'src')
-rw-r--r--src/report.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/report.h b/src/report.h
index 94d39215..75f3b1ff 100644
--- a/src/report.h
+++ b/src/report.h
@@ -362,7 +362,7 @@ public:
OPTION_(report_t, average, DO() { // -A
parent->HANDLER(display_total_)
- .set_expr(string("--average"), "total_expr/count");
+ .set_expr(string("--average"), "count>0?(total_expr/count):0");
});
OPTION__(report_t, balance_format_, CTOR(report_t, balance_format_) {