From 2d76d0d151239538c43b61572283405b10df43ac Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Fri, 25 Nov 2005 23:36:58 -0800 Subject: [PATCH] name-rev: fix off-by-one error in --stdin. It dropped the last hexdigit in the object name. [jc: Noticed and patch supplied by ALASCM, reworked to apply at the right place by me] Signed-off-by: Junio C Hamano --- name-rev.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/name-rev.c b/name-rev.c index 817e36b79..7d89401a4 100644 --- a/name-rev.c +++ b/name-rev.c @@ -217,10 +217,9 @@ int main(int argc, char **argv) if (!strcmp(name, "undefined")) continue; - fwrite(p_start, p - p_start, 1, stdout); - fputc('(', stdout); - fputs(name, stdout); - fputc(')', stdout); + fwrite(p_start, p - p_start + 1, 1, + stdout); + printf(" (%s)", name); p_start = p + 1; } } -- 2.26.2