Skip to content

Commit 1f976bd

Browse files
stefanbellergitster
authored andcommitted
apply.c::find_name_traditional(): do not initialize len to the line's length
The variable len is set to len = strchrnul(line, '\n') - line; unconditionally 9 lines later, hence we can remove the call to strlen. Signed-off-by: Stefan Beller <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 3def06e commit 1f976bd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

builtin/apply.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,7 @@ static char *find_name(const char *line, char *def, int p_value, int terminate)
722722

723723
static char *find_name_traditional(const char *line, char *def, int p_value)
724724
{
725-
size_t len = strlen(line);
725+
size_t len;
726726
size_t date_len;
727727

728728
if (*line == '"') {

0 commit comments

Comments
 (0)