James Carlson <[EMAIL PROTECTED]> wrote: > Joerg Schilling writes: > > I have a re-implementation in my libschily > [...] > > * WARNING: a NULL constant is not a NULL pointer, so a caller must > > * cast a NULL constant to a pointer: (char *)NULL > > How's that?
This is a conclusion from the C standard.... If you have #define NULL (char *)0 there is no problem but if you have #define NULL 0 as usual on UNIX, then you are able to do this correctly: char *p; p = 0; but you cannot place a NULL pointer in a vararglist this way as the compiler does not now the type of the lhs. For this reason, you need to cast in order to make your code work correctly on LP64 systems. If Sun did not check this already, I recommend to do this. I did 3 years ago for my code after an alert from the FreeBSD people. > > strcatl(char *to, ...) > > Sigh ... not safe from target overflow problems. It hasn't learned > the lessons of strcpy(3C) and gets(3C). I'd recommend at least fixing Well, this is an interface from 1982 and at that time there was no strncpy() either ;-) > that: > > strcatl(char *to, size_t tolen, ...) > > but, then, that calls the return value into question. The return > value probably shouldn't be a pointer to the "last" char if a bounded > output array is supplied because it then becomes impossible for the > caller to detect overflow. Could you explain this please? Jörg -- EMail:[EMAIL PROTECTED] (home) Jörg Schilling D-13353 Berlin [EMAIL PROTECTED] (uni) [EMAIL PROTECTED] (work) Blog: http://schily.blogspot.com/ URL: http://cdrecord.berlios.de/old/private/ ftp://ftp.berlios.de/pub/schily _______________________________________________ opensolaris-discuss mailing list opensolaris-discuss@opensolaris.org