Commit 9f86ec52 by Vicent Marti

signature: Fix warnings

Add extra braces to avoid ambiguous if-else.

Also, free() doesn't need a check.
parent a01acc47
...@@ -33,12 +33,8 @@ void git_signature_free(git_signature *sig) ...@@ -33,12 +33,8 @@ void git_signature_free(git_signature *sig)
if (sig == NULL) if (sig == NULL)
return; return;
if (sig->name) free(sig->name);
free(sig->name); free(sig->email);
if (sig->email)
free(sig->email);
free(sig); free(sig);
} }
...@@ -66,11 +62,12 @@ static int process_trimming(const char *input, char **storage, const char *input ...@@ -66,11 +62,12 @@ static int process_trimming(const char *input, char **storage, const char *input
left = skip_leading_spaces(input, input_end); left = skip_leading_spaces(input, input_end);
right = skip_trailing_spaces(input, input_end - 1); right = skip_trailing_spaces(input, input_end - 1);
if (right <= left) if (right <= left) {
if (fail_when_empty) if (fail_when_empty)
return git__throw(GIT_EINVALIDARGS, "Failed to trim. Input is either empty or only contains spaces"); return git__throw(GIT_EINVALIDARGS, "Failed to trim. Input is either empty or only contains spaces");
else else
right = left - 1; right = left - 1;
}
trimmed_input_length = right - left + 1; trimmed_input_length = right - left + 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment