Re: [TuxKart-devel] [patch] Command line arguments (Cleaner version?)
Status: Alpha
Brought to you by:
sjbaker
From: Ricardo C. <ri...@ae...> - 2004-07-12 20:48:39
|
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. Secondly, in the future, it could be possible to feed TuxKart with a track file. Yours might have problems with it. 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. 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. Sorry, I guess I just wake up in a bad mood. =) Cheers, Ricardo Em Segunda, 12 de Julho de 2004 09:04, o Pascal Giard escreveu: > Here's a different implementation of the same feature. > > It looks cleaner to me, but i may be wrong. > See what my previous email says about my C++ knowledge ;) > > -Pascal > PS: The patch was made against the CVS version of start_tuxkart.cxx . > -- > Projet MoviXMaker (http://sv.gnu.org/projects/movixmaker) > Projet [e]MoviX[2] (http://movix.sf.net) > Debian Project (http://www.debian.org) -- To a Californian, all New Yorkers are cold; even in heat they rarely go above fifty-eight degrees. If you collapse on a street in New York, plan to spend a few days there. -- From "East vs. West: The War Between the Coasts |