Commit f51d790
receive-pack: use find_commit_header() in check_cert_push_options()
Use the public function find_commit_header() instead of find_header() to
simplify the code. This is possible and safe because we're operating on
a strbuf, which is always NUL-terminated, so there is no risk of running
over the end of the buffer. It cannot contain NUL within the buffer, as
it is built using strbuf_addstr(), only.
The string comparison becomes more complicated because we need to check
for NUL explicitly after comparing the length-limited option, but on the
flip side we don't need to clean up allocations or track the remaining
buffer length.
Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>1 parent 3526e67 commit f51d790
1 file changed
+9
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
718 | 718 | | |
719 | 719 | | |
720 | 720 | | |
721 | | - | |
722 | 721 | | |
723 | | - | |
724 | | - | |
| 722 | + | |
| 723 | + | |
725 | 724 | | |
726 | 725 | | |
727 | 726 | | |
728 | 727 | | |
729 | | - | |
| 728 | + | |
730 | 729 | | |
731 | 730 | | |
732 | | - | |
733 | | - | |
734 | | - | |
| 731 | + | |
| 732 | + | |
735 | 733 | | |
736 | 734 | | |
737 | | - | |
738 | | - | |
739 | | - | |
740 | | - | |
741 | | - | |
742 | | - | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
743 | 739 | | |
744 | 740 | | |
745 | 741 | | |
746 | 742 | | |
747 | 743 | | |
748 | | - | |
749 | | - | |
750 | 744 | | |
751 | 745 | | |
752 | 746 | | |
| |||
0 commit comments