Bug#243363: [PATCH] xcruise: speed goes wild and segfaults on keypress

2006-05-14 Thread Julien BLACHE
Florian Ernst [EMAIL PROTECTED] wrote:

Hi Florian,

 Thanks a lot. This bug always was (and still is) unreproducible for
 me, despite numerous people on various distributions getting bitten.

 I'll test your patch and check with some people who have also
 encountered this segfault.

Any news on this ?

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 


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#243363: [PATCH] xcruise: speed goes wild and segfaults on keypress

2006-04-29 Thread Julien BLACHE
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;
 }