Re: [AD] 3.9.34 release date?

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On Wed, 10 Jan 2001, Olly Betts wrote:
> Incidentally, wouldn't it be safer to declare argv to have 129 entries
> rather than 64?  129 is the most a 256 character command line can possibly
> generate (all one character arguments plus terminating NULL), and 260 bytes
> of extra storage seems a small price to pay for elminating this potential
> overflow.
> 
> And is 256 a limit for the command line?  There's no limit mentioned in:

Well, I just tested the bash command line with the yes command, and I
successfully passed 216 'a's (total: 437 characters in command line). All
where handled correctly, so I don't think a fixed limit is a good idea.

Also, under unix shells, when you write something like "ls *", the
metacharacter * get's expanded before being passed to the program, so if
you do "ls *" in a big directory (over one thousand files), you will get
one thousand entries for argv. It works with standard programs, but it
would fail with Allegro programs if you limit it.

PD: Yes, it was fun to type all those 'a's :-)

 Grzegorz Adam Hankiewicz   gradha@xxxxxxxxxx - http://gradha.infierno.org
 Other web pages:  http://glub.ehu.es/  -  http://welcome.to/gogosoftware/



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/