git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH V2] TIG: Fix to reinstate proper operation with no arguments

From
Jonas Fonseca <fonseca@diku.dk>
Date
Jul 29, 2013, 01:23 UTC
Message-ID
<CAFuPQ1L336HsJdtpL9OOA9+2MDNqZQa6nVu9-kYUhdnCVn13dw@mail.gmail.com>
In-Reply-To
<1374670227-15677-1-git-send-email-n1xim.email@gmail.com>
On Wed, Jul 24, 2013 at 8:50 AM, Drew Northup <n1xim.email@gmail.com> wrote:
Show 7 quoted lines
> This time, knowing for sure now that format->buf is not being used in
> the extant code path for any other purpose, I went ahead and
> initialized the whole thing to be sure that we don't find any other
> ghosts hiding in that buffer between uses. Just initializing the
> first byte fixes the near term problem but does not prevent the buffer
> initialization issue that this bug highlighted from rising up again
> later on.
Thanks applied with minor tidyup.
Show 9 quoted lines
> diff --git a/tig.c b/tig.c
> index ba9ba98..c65bc43 100644
> --- a/tig.c
> +++ b/tig.c
> @@ -3104,8 +3104,12 @@ format_expand_arg(struct format_context *format, const char *name)
>  static bool
>  format_append_arg(struct format_context *format, const char ***dst_argv, const char *arg)
>  {
> +       int i;
Added space after the declaration.
>         format->bufpos = 0;
>
> +       for (i = 0; i < SIZEOF_STR; i++)
Changed this to use sizeof(format->buf) instead.
Show 8 quoted lines
> +               format->buf[i] = 0;
> +
>         while (arg) {
>                 char *next = strstr(arg, "%(");
>                 int len = next ? next - arg : strlen(arg);
> --
> 1.8.0
>
-- 
Jonas Fonseca
Previous: Drew Northup
Message 7 of 7 in “TIG: Fix to reinstate proper operation with no arguments”
  1. TIG: Fix to reinstate proper operation with no argumentsDrew Northup, Jul 18, 2013
  2. Drew NorthupJul 18, 2013
  3. Jonas FonsecaJul 19, 2013
  4. Drew NorthupJul 19, 2013
  5. Drew NorthupJul 24, 2013
  6. TIG: Fix to reinstate proper operation with no argumentsDrew Northup, Jul 24, 2013
  7. Jonas FonsecaJul 29, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.