Merge branch 'maint'

* maint:
  git-name-rev: don't use printf without format
This commit is contained in:
Junio C Hamano 2008-08-03 14:14:10 -07:00
commit 57b0fc4516

View File

@ -189,6 +189,7 @@ static void name_rev_line(char *p, struct name_ref_data *data)
unsigned char sha1[40]; unsigned char sha1[40];
const char *name = NULL; const char *name = NULL;
char c = *(p+1); char c = *(p+1);
int p_len = p - p_start + 1;
forty = 0; forty = 0;
@ -204,13 +205,10 @@ static void name_rev_line(char *p, struct name_ref_data *data)
if (!name) if (!name)
continue; continue;
if (data->name_only) { if (data->name_only)
fwrite(p_start, p - p_start + 1 - 40, 1, stdout); printf("%.*s%s", p_len - 40, p_start, name);
printf(name); else
} else { printf("%.*s (%s)", p_len, p_start, name);
fwrite(p_start, p - p_start + 1, 1, stdout);
printf(" (%s)", name);
}
p_start = p + 1; p_start = p + 1;
} }
} }