From 90c284765e8ec8d34a35eb4a3cf7ea443ad9017d Mon Sep 17 00:00:00 2001
From: Teemu Toivola <git@humdi.net>
Date: Tue, 25 Feb 2014 22:36:57 +0200
Subject: [PATCH] fix for loop bug in rebuild total that appears to have been
 there since version 1.1, thanks to William Epp for finding this

---
 src/vnstat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/vnstat.c b/src/vnstat.c
index b92afcd..a269471 100644
--- a/src/vnstat.c
+++ b/src/vnstat.c
@@ -485,7 +485,7 @@ int main(int argc, char *argv[]) {
 			readdb(interface, dirname);
 
 			data.totalrx=data.totaltx=data.totalrxk=data.totaltxk=0;
-			for (i=0; i<=29; i++) {
+			for (i=0; i<=11; i++) {
 				if (data.month[i].used) {
 					addtraffic(&data.totalrx, &data.totalrxk, data.month[i].rx, data.month[i].rxk);
 					addtraffic(&data.totaltx, &data.totaltxk, data.month[i].tx, data.month[i].txk);
-- 
2.40.0