Re: [TuxKart-devel] [patch] Command line arguments (Cleaner version?)
Status: Alpha
Brought to you by:
sjbaker
From: Pascal G. <pa...@gu...> - 2004-07-13 01:47:19
|
On Mon, 12 Jul 2004 21:52:59 +0100, Ricardo Cruz wrote > The problem with yours is that you only read the first letter of > the arguments. If it is ever implemented more arguments, one would > have to avoid giving an argument that started with the same letter > of another. yup, i totally agree. btw, both patches are mine. > Secondly, in the future, it could be possible to feed TuxKart with > a track file. Yours might have problems with it. yes, having to give the track number is very ugly. it would be nicer to give the track name as an argument. > Besides, it can result in a seg fault if the given argument is > smaller than 3 characters, since it doesn't do any checking. And > even allowing over buffer overflow. indeed. it was a quick and dirty patch. i repeat, i don't have any C/C++ experience. I usually validate with regexp, but C++ isn't perl ;) > The other is just fine, just need to change the while to a for, > since it is really ugly to increment 'i' all the time. yup. > Sorry, I guess I just wake up in a bad mood. =) don't be sorry! i'm happy you gave some constructive comments! should i modify my patch do add some corrections or one of you guys will take care of that ? i just wanted to give a hand. -Pascal -- Projet MoviXMaker (http://sv.gnu.org/projects/movixmaker) Projet [e]MoviX[2] (http://movix.sf.net) Debian Project (http://www.debian.org) |