Monday, April 30, 2007

The rally car is ready to go... finally

So after deciding to change the gearbox last weekend to put the new, fancy one in (close ratio, 4.8 crownwheel and pinion and a limited slip diff) which went fine. We decided to change the pads and put a new set of mintex on. Nice and simple... right? No, the pads went in fine on one side but on the other we couldn't fit the pads into the caliper.

After much deliberating and measuring to try and diagnose the problem we finally noticed that the hub on the side the pads had gone into had the wrong offset on it. Both sides had 1.9 discs on which have a different offset to the 1.6. The disc offset was screwing up the side that had the proper 1.6 hub on it.

We managed to get hold of another hub in the week and after spending Saturday making some tools to let us change the bearings easier we got it fitted on Sunday. We can now change the bearings a lot easier which is handy so a productive weekend all in all.

Took the pug otu for a test drive after we had put it all back together and the new gearbox seems lots better, should give us a lot better traction due to the LSD and also quite a bit better acceleration. Brint it on.....

Labels:

Thursday, April 19, 2007

Ways to tell you're getting older

Here's the first in my set of quotes I seem to come up with every now and then about getting older :)

1.
You're definately getting older if you are driving home from work, see a garden center and think to yourself 'ooo, a garden centre, I'll stop and have a look round'..

How sad am I now...

More to come no doubt

Wednesday, April 11, 2007

Buffer Overflow

Ok, a nice little post to remind myself not to be such a tard.

char *toPm = (char *)malloc(strlen(cd.nick) + strlen(message) + 6) ;

Looks fine, is fine, toPm was for the folliwing operation :

sprintf(toPm, "%s : %s\r\n", cd.nick, message) ;

Now I counted up, checked everything counted again and came to 6 extras both times, space before the ':', the ':' itself, a space after, the \r, the \n and null. everything seems fine. No, getting segfualts every now and then. Quite annoying, gdb to the rescue, getting errors in adding text to a wxTextCtrl. Still can't fidn the problem. More digging ensued. Finally realised that there were two spaces before the damn ':'. That would screw it up. Changed to +7 in the malloc and all seems well. One moral to this story really.

USE SNPRINTF().........................

Should have learnt years ago, nm onwards and upwards.....