git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Eric Sunshine <sunshine@sunshineco.com>
To: Benoit Pierre <benoit.pierre@gmail.com>
Cc: Git List <git@vger.kernel.org>
Subject: Re: [PATCH 1/2] status: allow NULL fmt for status_printf/status_vprintf_ln
Date: Mon, 10 Mar 2014 16:13:44 -0400	[thread overview]
Message-ID: <CAPig+cTzVO1kJCM0zTiDza+Na4PHeLpAr1dvqsXxfbmpy-egHA@mail.gmail.com> (raw)
In-Reply-To: <1394479647-22361-2-git-send-email-benoit.pierre@gmail.com>

On Mon, Mar 10, 2014 at 3:27 PM, Benoit Pierre <benoit.pierre@gmail.com> wrote:
> Useful for calling status_printf only to change/reset the color (and
> output an additional '\n' with status_vprintf_ln).
>
> Signed-off-by: Benoit Pierre <benoit.pierre@gmail.com>
> ---
>  wt-status.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/wt-status.c b/wt-status.c
> index 4e55810..17f63a4 100644
> --- a/wt-status.c
> +++ b/wt-status.c
> @@ -49,7 +49,8 @@ static void status_vprintf(struct wt_status *s, int at_bol, const char *color,
>         struct strbuf linebuf = STRBUF_INIT;
>         const char *line, *eol;
>
> -       strbuf_vaddf(&sb, fmt, ap);
> +       if (NULL != fmt)

In this codebase,

    if (fmt)

would be more idiomatic.

> +           strbuf_vaddf(&sb, fmt, ap);
>         if (!sb.len) {
>                 if (s->display_comment_prefix) {
>                         strbuf_addch(&sb, comment_line_char);
> --
> 1.9.0

  reply	other threads:[~2014-03-10 20:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-10 19:27 [PATCH 0/2] fix status_printf_ln calls "zero-length format" warnings Benoit Pierre
2014-03-10 19:27 ` [PATCH 1/2] status: allow NULL fmt for status_printf/status_vprintf_ln Benoit Pierre
2014-03-10 20:13   ` Eric Sunshine [this message]
2014-03-10 19:27 ` [PATCH 2/2] fix status_printf_ln calls "zero-length format" warnings Benoit Pierre
2014-03-10 19:51 ` [PATCH 0/2] " Jeff King
2014-03-11 19:25   ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAPig+cTzVO1kJCM0zTiDza+Na4PHeLpAr1dvqsXxfbmpy-egHA@mail.gmail.com \
    --to=sunshine@sunshineco.com \
    --cc=benoit.pierre@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).