X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;f=ui.c;h=6c225ab037cb651a7157086affeee3afa35f54c5;hb=86c8146a56d57702a7e17eb8782bc63247d5db8e;hp=dc7e2c9cab449c3bf87f74103191dfcb200d8086;hpb=ed898ff3dce54b90159d6806618968960908332c;p=speedometer diff --git a/ui.c b/ui.c index dc7e2c9..6c225ab 100644 --- a/ui.c +++ b/ui.c @@ -219,6 +219,15 @@ void interpret_and_set_speed(gdouble speed) { */ speed *= conversion[unit]; + /* we need to limit the speed down to + * less than 1000 whatever or else hell + * breaks loose in the form of assert + */ + if(!(fabs(speed) < 1000)) { + g_print("Ahem, may I suggest to limit the speed (%f) a bit, Sir.\n", speed); + speed = 0; + } + /* Convert float to a 6 digits (including dot) wide * string with leading zeros. After conversion * the speed looks like: