[FreeVMS] Re: new str$ routines - to NULL or not to NULL, that is the question....

Roar Thronæs roart at nvg.ntnu.no
Ven 12 Aou 09:46:57 CEST 2005


On Thu, 11 Aug 2005, Roger Tucker wrote:

> I know this question will come up over and over again, but I found an
> interesting example for us to work with.  I noticed that the str$ routines
> shipped with freeVMS have been bastardized to always place a null at the end
> of dynamic string descriptor - see strget1_dx.c for example.  It allocates
> one extra byte for the null and makes sure it's zero using calloc().  The

Where does it allocate one extra byte?
I could not find it.

> original code is even commented out!  It's not correct, because in the same
> routine on a new string descriptor it's broke, but someone tried to change
> it and that's why the strlen() was in str$copy_dx().
>
> So, should the str$ routines work just like the ones on real VMS, or should
> they try to keep a null at the end?

I see no real reason why there should be 0 at end.

--
Regards,
Roar Thronæs



Plus d'informations sur la liste de diffusion FreeVMS