[master] f9dd498 Error out if extra arguments were supplied

Dridi Boukelmoune dridi at varni.sh
Tue Jul 26 12:24:24 CEST 2016


Hi,

Please don't mind the top post, I'm just writing the -commit list to
inform that we haven't had commits sent via this list since this one.

Dridi

On Wed, Jul 20, 2016 at 2:26 PM, Federico G. Schwindt <fgsch at lodoss.net> wrote:
>
> commit f9dd498fcbe5307c0b1b9a797fda69b1ca9c521f
> Author: Federico G. Schwindt <fgsch at lodoss.net>
> Date:   Wed Jul 20 13:19:12 2016 +0100
>
>     Error out if extra arguments were supplied
>
>     Reported by Michel Schuster.
>
> diff --git a/bin/varnishhist/varnishhist.c b/bin/varnishhist/varnishhist.c
> index d58d1ab..1a84912 100644
> --- a/bin/varnishhist/varnishhist.c
> +++ b/bin/varnishhist/varnishhist.c
> @@ -427,6 +427,10 @@ main(int argc, char **argv)
>                                 usage(1);
>                 }
>         }
> +
> +       if (optind != argc)
> +               usage(1);
> +
>         /* Check for valid grouping mode */
>         assert(VUT.g_arg < VSL_g__MAX);
>         if (VUT.g_arg != VSL_g_vxid && VUT.g_arg != VSL_g_request)
> diff --git a/bin/varnishstat/varnishstat.c b/bin/varnishstat/varnishstat.c
> index 46cb300..45aa6e8 100644
> --- a/bin/varnishstat/varnishstat.c
> +++ b/bin/varnishstat/varnishstat.c
> @@ -315,6 +315,9 @@ main(int argc, char * const *argv)
>                 }
>         }
>
> +       if (optind != argc)
> +               usage(1);
> +
>         if (!(xml || json || once || f_list))
>                 curses = 1;
>
> diff --git a/bin/varnishtop/varnishtop.c b/bin/varnishtop/varnishtop.c
> index 93d61b9..ff2c40c 100644
> --- a/bin/varnishtop/varnishtop.c
> +++ b/bin/varnishtop/varnishtop.c
> @@ -358,6 +358,9 @@ main(int argc, char **argv)
>                 }
>         }
>
> +       if (optind != argc)
> +               usage(1);
> +
>         VUT_Setup();
>         if (!once) {
>                 if (pthread_create(&thr, NULL, do_curses, NULL) != 0) {
>
> _______________________________________________
> varnish-commit mailing list
> varnish-commit at varnish-cache.org
> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-commit



More information about the varnish-commit mailing list