Skip to content

Commit

Permalink
apply.c::find_name_traditional(): do not initialize len to the line's…
Browse files Browse the repository at this point in the history
… 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 <stefanbeller@googlemail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Stefan Beller authored and Junio C Hamano committed Jul 19, 2013
1 parent 3def06e commit 1f976bd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion builtin/apply.c
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,7 @@ static char *find_name(const char *line, char *def, int p_value, int terminate)

static char *find_name_traditional(const char *line, char *def, int p_value)
{
size_t len = strlen(line);
size_t len;
size_t date_len;

if (*line == '"') {
Expand Down

0 comments on commit 1f976bd

Please sign in to comment.