Hello Darin.
19 Mar 98 19:31, Darin McBride wrote to Adam Majer:
SL>>int main(void)
SL>> {
SL>> char *sTemp;
SL>> int iTemp;
AM>> sTemp = (char*)malloc(sizeof(char)*256); <- enough space for 256 digits!
DM> Space for 255 plus the nul. However...
DM> Rather a bit of overkill since 16-bit ints can only have 5 bytes (plus
the
DM> nul) = 6. ;-)
Not really since the assumption here would be that the idiot user
will probably dose off with his hand on a key and then press enter
without backspacing first. I mean, I think that is what Adam is
looking at here. That would mean that the string length was not
being limited in the format string too. Then there is the shell to
consider. COMMNAD.COM only lets you enter 127 characters. I think
many other shells, 4DOS, bash, etc... let you enter about twice
that many.
-Roger
... 'If it ain't broke, you can probably still fix it.' - Tim Allen
--- Msged 4.20 beta 3
(1:273/404@fidonet)
---------------
* Origin: Hodge-Podge Support BBS, Upper Darby, Pennsylvania, USA
|