From: Junio C Hamano <gitster@pobox.com>
To: Brian Gernhardt <brian@gernhardtsoftware.com>
Cc: Git List <git@vger.kernel.org>, Sam Hocevar <sam@zoy.org>
Subject: Re: git-grep Bus Error
Date: Sun, 08 Mar 2009 18:18:46 -0700 [thread overview]
Message-ID: <7vprgrijd5.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <7vtz63ijoz.fsf@gitster.siamese.dyndns.org> (Junio C. Hamano's message of "Sun, 08 Mar 2009 18:11:40 -0700")
Junio C Hamano <gitster@pobox.com> writes:
> Brian, would this patch help?
>
> grep.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/grep.c b/grep.c
> index cace1c8..dcdbd5e 100644
> --- a/grep.c
> +++ b/grep.c
> @@ -490,9 +490,9 @@ static void show_line(struct grep_opt *opt, char *bol, char *eol,
> *eol = '\0';
> while (next_match(opt, bol, eol, ctx, &match, eflags)) {
> printf("%.*s%s%.*s%s",
> - match.rm_so, bol,
> + (int) match.rm_so, bol,
> opt->color_match,
> - match.rm_eo - match.rm_so, bol + match.rm_so,
> + (int)(match.rm_eo - match.rm_so), bol + match.rm_so,
> GIT_COLOR_RESET);
> bol += match.rm_eo;
> rest -= match.rm_eo;
I looked at all the hits from
$ git grep -n -e 'printf.*%\.\*s' --and --not -e '(int)'
The above should be the only two places that need fixing.
next prev parent reply other threads:[~2009-03-09 1:20 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-08 23:27 git-grep Bus Error Brian Gernhardt
2009-03-08 23:41 ` Sam Hocevar
2009-03-09 0:58 ` Brian Gernhardt
2009-03-09 1:11 ` Junio C Hamano
2009-03-09 1:18 ` Junio C Hamano [this message]
2009-03-09 1:19 ` Brian Gernhardt
2009-03-09 1:24 ` [PATCH] grep: cast printf %.*s "precision" argument explicitly to int Junio C Hamano
2009-03-09 1:48 ` git-grep Bus Error Brian Gernhardt
2009-03-09 0:29 ` 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=7vprgrijd5.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=brian@gernhardtsoftware.com \
--cc=git@vger.kernel.org \
--cc=sam@zoy.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.
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).