httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Randy Terbush <ra...@zyzzyva.com>
Subject Re: [BUG]: "segv attempting to run some cgis" on OTHER:qnx
Date Sun, 02 Mar 1997 18:47:11 GMT
> > > 	- av[idx] = '\0' should be NULL instead of '\0'
> > 
> > ?? array of char *?
> 
> av is a **char.  av[idx] is a *char.  A pointer is not '\0', it is NULL.
> If you would not say av[idx] = 'a' you should not say av[idx] = '\0'.
> 
> No?

You are correct.

> > > 	- I didn't think that va_arg would necessarily work properly
> > > 	  with a NULL (ie. the NULL termination), since NULL is
> > > 	  generally 0 and 0 is an int not a char* so va_arg may not
> > > 	  match it?
> > 
> > Hmm, I had thought that last I looked NULL was void *(0) or 
> > something. You are correct though that it is 0 on FreeBSD. and BSDI.
> 
> ...and AIX and Solaris and SunOS and IRIX.  So should wherever we
> call create_argv, like:
> 	
>             execv(r->filename, create_argv(r, argv0, r->args, NULL));
> 
> be changed to something like:
> 
>             execv(r->filename, create_argv(r, argv0, r->args, (void *)NULL));
> 
> ?  It works as it is, but is that just the compiler being smarter than it
> has to?  I know I have C books somewhere that warn against using NULL
> without casting in this situation... 

Can't hurt. I'll prepare a patch.






Mime
View raw message