From: Junio C Hamano <gitster@pobox.com>
To: Carlos Rica <jasampler@gmail.com>
Cc: Johannes Schindelin <Johannes.Schindelin@gmx.de>,
gitster@pobox.com, git@vger.kernel.org
Subject: Re: [PATCH] builtin-tag.c: remove global variable to use the callback data of git-config.
Date: Tue, 17 Mar 2009 11:45:41 -0700 [thread overview]
Message-ID: <7vljr4q97u.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <1b46aba20903171057r4fb4697eo3b8abc62a45fe858@mail.gmail.com> (Carlos Rica's message of "Tue, 17 Mar 2009 18:57:28 +0100")
Carlos Rica <jasampler@gmail.com> writes:
> On Tue, Mar 17, 2009 at 4:47 PM, Johannes Schindelin
> <Johannes.Schindelin@gmx.de> wrote:
>> Hi,
>> On Tue, 17 Mar 2009, Carlos Rica wrote:
>>> @@ -164,11 +162,10 @@ static int do_sign(struct strbuf *buffer)
>>> int len;
>>> int i, j;
>>>
>>> - if (!*signingkey) {
>>> - if (strlcpy(signingkey, git_committer_info(IDENT_ERROR_ON_NO_NAME),
>>> - sizeof(signingkey)) > sizeof(signingkey) - 1)
>>> - return error("committer info too long.");
>>> - bracket = strchr(signingkey, '>');
>>> + if (!signingkey->buf[0]) {
>>
>> It is probably better to ask for !signingkey->len (think of trying to
>> understand the code in 6 months from now).
>
> I was in doubt here. By avoiding the use of signingkey->len I was
> trying to say that you cannot rely in such field if we touch the
> buffer directly, as it happens below:
>
> bracket = strchr(signingkey->buf, '>');
> if (bracket)
> bracket[1] = '\0';
That's a wrong use of strbuf, isn't it?
next prev parent reply other threads:[~2009-03-17 18:47 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-17 14:43 [PATCH] builtin-tag.c: remove global variable to use the callback data of git-config Carlos Rica
2009-03-17 15:47 ` Johannes Schindelin
2009-03-17 17:57 ` Carlos Rica
2009-03-17 18:45 ` Junio C Hamano [this message]
2009-03-17 22:27 ` Johannes Schindelin
2009-03-18 0:50 ` Carlos Rica
-- strict thread matches above, loose matches on Subject: below --
2009-03-24 19:54 Carlos Rica
2009-03-14 7:17 Carlos Rica
2009-03-14 20:54 ` Junio C Hamano
2009-03-16 11:46 ` Carlos Rica
2009-03-10 13:03 Carlos Rica
2009-03-10 13:34 ` Johannes Schindelin
2009-03-10 14:00 ` Carlos Rica
2009-03-10 16:36 ` 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=7vljr4q97u.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=jasampler@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).