[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Rep:Rep:Re: Rep:Re: [f-cpu] Stack handling

Christian M. Schubert wrote:

> IMHO Zero terminated strings are the root of all evil. Explicit length
> specification would require an additional parameter per passed string
> (that seems to be a pain in the a** for some guys) but seems to be
> getting more popular (at least in the newer functions in the Windows
> API some functions require you to pass pointer to a string and the
> length). That makes it far more easier to check for buffer overflows
> (but still needs extra code to be written what most programmers tend
> to avoid if possible). From that point of view it is indeed very hard
> to check buffer sizes (at least in C)... however, I wouldn't encourage
> that behaviour so don't let the CPU do things which the programmer
> has to take care of.

I think it is more of a case of unrestriced parameters
and undefined limits. The problem is finding the pesudo-constants used
in a program and modifing how we think about program design. Say you
have parsing routing that say "speaks your files selected". What happens
if you save a email from a friend who speaks Japanese? Can the program
be modifed from a config file or is it hard coded? What hapens if you
have Windows 2040 with unlimited length file names? True people
make mistakes but software design works best only you have written it
a few times from scratch. :(

Ben Franchuk - Dawn * 12/24 bit cpu *

To unsubscribe, send an e-mail to majordomo@seul.org with
unsubscribe f-cpu       in the body. http://f-cpu.seul.org/