[Info-vax] Whither VMS?
ChrisQ
meru at devnull.com
Thu Oct 1 16:39:15 EDT 2009
P. Sture wrote:
> In article <7if6l2F30a3ujU2 at mid.individual.net>,
> Bob Eager <rde42 at spamcop.net> wrote:
>
>> By 'quality', I meant well written, i.e. properly laid out, commented,
>> maintainable. It works OK!
>
> The thing that raised warning signals with me once I saw the NT APIs was
> the dependence on null terminated strings. I'd spent a lot of time in
> VMS applications eradicating those by adding a length parameter or using
> descriptors.
>
> And when CPU was the limiting factor, I didn't see the point of scanning
> a string parameter to find the terminating null when the calling routine
> knew the length of the string in the first place.
>
Well, you don't always know the length of the string and one way way is
for the caller to know the buffer limits of the function that's being
called and range check before calling. Either that (or preferably) the
called function needs to range check any input during the copy to make
sure it doesn't overflow it's own buffer. It has no real impact on
performance. If you do any buffer copy without this, you deserve what
you get.
But we are a bit out of date here - The later C lib functions like
strncpy() did have a length parameter and stuff like this has been
around in the C lib for 15+ years.
It's not the tools that are the problem, but those who use them :-)...
Regards,
Chris
More information about the Info-vax
mailing list