diff options
author | Patrick Steinhardt <ps@pks.im> | 2024-12-06 11:27:29 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-12-06 20:20:05 +0900 |
commit | efb38ad49fb2dd7bf6e732df0c59f3c1aeba2f76 (patch) | |
tree | b25430a3ffe7f797f0274da2bb0e97c71b251e8a /builtin/commit.c | |
parent | 6411a0a896d0ca00effa9b7a67ea0655257b9832 (diff) |
builtin/patch-id: fix type of `get_one_patchid()`
In `get_one_patchid()` we assign either the result of `strlen()` or
`remove_space()` to `len`. But while the former correctly returns a
`size_t`, the latter returns an `int` to indicate the length of the
stripped string even though it cannot ever return a negative value. This
causes a warning with "-Wsign-conversion".
In fact, even `get_one_patchid()` itself is also using an integer as
return value even though it always returns the length of the patch, and
this bubbles up to other callers.
Adapt the function and its helpers to use `size_t` for string lengths
consistently.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/commit.c')
0 files changed, 0 insertions, 0 deletions