Commit 30e77bc
pretty: simplify input line length calculation in pp_user_info()
Instead of searching for LF and NUL with two strchr() calls use a single
strchrnul() call. We don't need to check if the returned pointer is NULL
because either we'll find the NUL at the end of line, or the caller
forgot to NUL-terminate the string and we'll overrun the buffer in any
case. Also we don't need to pass LF or NUL to split_ident_line() as it
ignores it anyway.
Signed-off-by: Rene Scharfe <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>1 parent de5abe9 commit 30e77bc
1 file changed
+2
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
413 | 413 | | |
414 | 414 | | |
415 | 415 | | |
416 | | - | |
417 | 416 | | |
418 | 417 | | |
419 | 418 | | |
| |||
422 | 421 | | |
423 | 422 | | |
424 | 423 | | |
425 | | - | |
426 | | - | |
427 | | - | |
428 | | - | |
429 | | - | |
430 | | - | |
431 | | - | |
432 | | - | |
433 | | - | |
| 424 | + | |
| 425 | + | |
434 | 426 | | |
435 | 427 | | |
436 | | - | |
437 | 428 | | |
438 | 429 | | |
439 | 430 | | |
| |||
0 commit comments