Ping?

On Mon, Dec 14, 2015 at 09:24:21AM -0800, Serguey Parkhomovsky wrote:
> This patch removes the copy argument to addarg, which is unneeded. No
> functional change.
> 
> Index: mailwrapper.c
> ===================================================================
> RCS file: /cvs/src/usr.sbin/mailwrapper/mailwrapper.c,v
> retrieving revision 1.21
> diff -u -p -r1.21 mailwrapper.c
> --- mailwrapper.c     14 Dec 2015 02:56:07 -0000      1.21
> +++ mailwrapper.c     14 Dec 2015 16:42:14 -0000
> @@ -51,7 +51,7 @@ struct arglist {
>  int main(int, char *[], char *[]);
>  
>  static void initarg(struct arglist *);
> -static void addarg(struct arglist *, const char *, int);
> +static void addarg(struct arglist *, const char *);
>  
>  extern const char *__progname;       /* from crt0.o */
>  
> @@ -65,7 +65,7 @@ initarg(struct arglist *al)
>  }
>  
>  static void
> -addarg(struct arglist *al, const char *arg, int copy)
> +addarg(struct arglist *al, const char *arg)
>  {
>       if (al->argc == al->maxc) {
>               al->maxc <<= 1;
> @@ -73,11 +73,8 @@ addarg(struct arglist *al, const char *a
>               if (al->argv == NULL)
>                       err(1, "realloc");
>       }
> -     if (copy) {
> -             if ((al->argv[al->argc++] = strdup(arg)) == NULL)
> -                     err(1, "strdup");
> -     } else
> -             al->argv[al->argc++] = (char *)arg;
> +
> +     al->argv[al->argc++] = (char *)arg;
>  }
>  
>  int
> @@ -98,7 +95,7 @@ main(int argc, char *argv[], char *envp[
>  
>       initarg(&al);
>       for (len = 0; len < argc; len++)
> -             addarg(&al, argv[len], 0);
> +             addarg(&al, argv[len]);
>  
>       config = fopen(_PATH_MAILERCONF, "r");
>  
> @@ -106,7 +103,7 @@ main(int argc, char *argv[], char *envp[
>               err(1, "pledge");
>  
>       if (config == NULL) {
> -             addarg(&al, NULL, 0);
> +             addarg(&al, NULL);
>               openlog(__progname, LOG_PID, LOG_MAIL);
>               syslog(LOG_INFO, "cannot open %s, using %s as default MTA",
>                   _PATH_MAILERCONF, _PATH_DEFAULTMTA);
> @@ -145,7 +142,7 @@ main(int argc, char *argv[], char *envp[
>                       for (ap = strsep(&cp, WS); ap != NULL;
>                           ap = strsep(&cp, WS))
>                               if (*ap)
> -                                     addarg(&al, ap, 0);
> +                                     addarg(&al, ap);
>                       break;
>               }
>  
> @@ -154,7 +151,7 @@ main(int argc, char *argv[], char *envp[
>  
>       (void)fclose(config);
>  
> -     addarg(&al, NULL, 0);
> +     addarg(&al, NULL);
>  
>       execve(to, al.argv, envp);
>       err(1, "cannot exec %s", to);

Reply via email to