mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
Fix non-literal format in printf-style calls
These were found using gcc 4.3.2-1ubuntu11 with the warning:
warning: format not a string literal and no format arguments
Incorporated suggestions from Brandon Casey <casey@nrlssc.navy.mil>.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
989206f535
commit
9db56f71b9
6
grep.c
6
grep.c
@@ -507,7 +507,7 @@ static int grep_buffer_1(struct grep_opt *opt, const char *name,
|
||||
if (from <= last_shown)
|
||||
from = last_shown + 1;
|
||||
if (last_shown && from != last_shown + 1)
|
||||
printf(hunk_mark);
|
||||
fputs(hunk_mark, stdout);
|
||||
while (from < lno) {
|
||||
pcl = &prev[lno-from-1];
|
||||
show_line(opt, pcl->bol, pcl->eol,
|
||||
@@ -517,7 +517,7 @@ static int grep_buffer_1(struct grep_opt *opt, const char *name,
|
||||
last_shown = lno-1;
|
||||
}
|
||||
if (last_shown && lno != last_shown + 1)
|
||||
printf(hunk_mark);
|
||||
fputs(hunk_mark, stdout);
|
||||
if (!opt->count)
|
||||
show_line(opt, bol, eol, name, lno, ':');
|
||||
last_shown = last_hit = lno;
|
||||
@@ -528,7 +528,7 @@ static int grep_buffer_1(struct grep_opt *opt, const char *name,
|
||||
* we need to show this line.
|
||||
*/
|
||||
if (last_shown && lno != last_shown + 1)
|
||||
printf(hunk_mark);
|
||||
fputs(hunk_mark, stdout);
|
||||
show_line(opt, bol, eol, name, lno, '-');
|
||||
last_shown = lno;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user