@matheusbsbs / matheus-bagliano / commits / 2d76d0d151
Fork 0

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 <junkio@cox.net>

Junio C Hamano committed Nov 25, 2005 at 23:36 UTC 2d76d0d151239538c43b61572283405b10df43ac
1 file changed +3 -4
name-rev.c
+3 -4
@@ -217,10 +217,9 @@ int main(int argc, char **argv)
217 if (!strcmp(name, "undefined"))
218 continue;
219
220 - fwrite(p_start, p - p_start, 1, stdout);
221 - fputc('(', stdout);
222 - fputs(name, stdout);
223 - fputc(')', stdout);
220 + fwrite(p_start, p - p_start + 1, 1,
221 + stdout);
222 + printf(" (%s)", name);
223 p_start = p + 1;
224 }
225 }