When showing a commit message, do not lose an incomplete line.
Linus Torvalds committed
Apr 12, 2006 at 11:31 UTC
684958ae6162c593bd90ba893271ffb2381c3c44
1 file changed
+2
-2
commit.c
+2
-2
@@ -400,11 +400,11 @@ static int get_one_line(const char *msg, unsigned long len)
400
401
while (len--) {
402
char c = *msg++;
403
+ if (!c)
404
+ break;
405
ret++;
406
if (c == '\n')
407
break;
406
- if (!c)
407
- return 0;
408
}
409
return ret;
410
}