httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rob Hartill <hart...@ooo.lanl.gov>
Subject Re: argv[0] inconsistencies?
Date Thu, 22 Jun 1995 13:52:57 GMT
 
> maybe this'd be better...
> 
> 
>    inststr  (utils.c)
> 
> 
>     char *ptr, len_dest, len_src;
> 
>     ptr = dst[0];                    /* ptr to string to overwrite */
>     len_dest = strlen(ptr);
>     len_src = strlen(src);
>     strncpy(ptr, src, len_dest);     /* overwrite the string */
> 
>     ptr += len_src;                 /* find end of new string */
>     while (len_src++ < len_dest) *ptr = ' ';  /* if it's shorter, add spaces */


                                 *ptr++

              of course.
 
> 
>     /* string was terminated by a '\0', and we haven't trashed it */
>     return;


This works under SunOs - the old version didn't.

--
http://nqcd.lanl.gov/~hartill/

Mime
View raw message