On Fri, Oct 22, 2010 at 3:38 PM, Alexander Shishkin <[email protected]> wrote:
> Signed-off-by: Alexander Shishkin <[email protected]>
> ---
>  procps/watch.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/procps/watch.c b/procps/watch.c
> index 36f71c4..0d1118d 100644
> --- a/procps/watch.c
> +++ b/procps/watch.c
> @@ -47,7 +47,7 @@ int watch_main(int argc UNUSED_PARAM, char **argv)
>        // watch ls -l "a /tmp" "2>&1" - ls won't see "a /tmp" as one param
>        cmd = *argv;
>        while (*++argv)
> -               cmd = xasprintf("%s %s", cmd, *argv); // leaks cmd
> +               *(*argv - 1) = ' ';

Bug. getopt reorders argv[].

-- 
vda
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to