tags 243363 patch
thanks

Hi,

The attached patch fixes this issue. There was a missing case in
do_brake(), as a result the speed would start to decrease endlessly at
startup, leading to the segfault.

Works for me on amd64, please test, confirm & upload :)

JB.

-- 
 Julien BLACHE <[EMAIL PROTECTED]>  |  Debian, because code matters more 
 Debian & GNU/Linux Developer        |       <http://www.debian.org>
 Public key available on <http://www.jblache.org> - KeyID: F5D6 5169 
 GPG Fingerprint : 935A 79F1 C8B3 3521 FD62 7CC7 CD61 4FD7 F5D6 5169 

--- xcruise-0.30.orig/MainScreen.c
+++ xcruise-0.30/MainScreen.c
@@ -1150,10 +1150,13 @@
 static void do_brake(MainScreenWidget me, double arg1)
 {
     double v = me->mainScreen.velocity;
-    if (0 < v) {
+#ifdef DEBUG_EVENT
+    fprintf(stderr, "do_brake: velocity %0.02f, brake %0.02f\n", v, arg1);
+#endif
+    if (v > 0) {
 	v -= arg1 * (fabs(me->mainScreen.velocity)+1.0);
 	if (v < 0) v = 0;
-    } else {
+    } else if (v < 0) {
 	v += arg1 * (fabs(me->mainScreen.velocity)+1.0);
 	if (0 < v) v = 0;
     }

Reply via email to