From ae3f75c09eaf8c7ccefb282cb7a785ece9c1abcb Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Sun, 14 Sep 2014 12:57:19 -0500 Subject: [PATCH] wmppp.app: Display speed in K when too high. When the download speed is too high, wmppp can't display it because it has only 5 digit. The most significant digits are hidden ! This small patch display the speed in K when it is too high. Based on the patch by jguiton . See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=328699. --- wmppp.app/wmppp/wmppp.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/wmppp.app/wmppp/wmppp.c b/wmppp.app/wmppp/wmppp.c index 93adefa..97d386f 100644 --- a/wmppp.app/wmppp/wmppp.c +++ b/wmppp.app/wmppp/wmppp.c @@ -771,6 +771,11 @@ void DrawStats(int *his, int num, int size, int x_left, int y_bottom) { void PrintLittle(int i, int *k) { switch (i) { + case -2: + *k -= 5; + /* Print the "k" letter */ + copyXPMArea(11*5-5, 86, 4, 9, *k, 48); + break; case -1: *k -= 5; copyXPMArea(13*5-5, 86, 4, 9, *k, 48); @@ -836,6 +841,13 @@ void DrawLoadInd(int speed) { k = 30; + /* If speed is greater than 99999, display it in K */ + if (speed > 99999 ) + { + speed /= 1024 ; + PrintLittle(-2, &k) ; + } + do { PrintLittle(speed % 10, &k); speed /= 10;