git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
To: Tanay Abhra <tanayabh@gmail.com>
Cc: git@vger.kernel.org, Ramkumar Ramachandra <artagnon@gmail.com>
Subject: Re: [PATCH] string-list.h: Add a value to string_list initializer lists
Date: Mon, 02 Jun 2014 12:54:51 +0200	[thread overview]
Message-ID: <vpqa99vr37o.fsf@anie.imag.fr> (raw)
In-Reply-To: <1401699504-29826-1-git-send-email-tanayabh@gmail.com> (Tanay Abhra's message of "Mon, 2 Jun 2014 01:58:24 -0700")

Tanay Abhra <tanayabh@gmail.com> writes:

> Add a NULL value in the end of STRING_LIST_INIT_NODUP and
> STRING_LIST_DUP to initialize `compare_strings_fn`.
>
> Signed-off-by: Tanay Abhra <tanayabh@gmail.com>
> ---
> When I used a malloced string_list to play around with string-list API and
> used the default init_list, it caused a seg fault. After an hour of debugging
> I saw that comapre_strings_fn should be initialized to NULL. In C, even an
> incomplete initialzer initializes every value to NULl or 0, so in normal
> usage in the codebase this problem never occurs. Still it is better to be
> thorough.

Part of this comment should be in the commit message itself. The "I
used ..." part should not (it is your experience), but the last two
sentences make sense IMHO.

Other than that, the changes sounds good.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

  reply	other threads:[~2014-06-02 10:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-02  8:58 [PATCH] string-list.h: Add a value to string_list initializer lists Tanay Abhra
2014-06-02 10:54 ` Matthieu Moy [this message]
2014-06-02 20:00 ` 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

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

  git send-email \
    --in-reply-to=vpqa99vr37o.fsf@anie.imag.fr \
    --to=matthieu.moy@grenoble-inp.fr \
    --cc=artagnon@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=tanayabh@gmail.com \
    /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.
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 NNTP newsgroup(s).