Skip to content

Commit 0c4d24d

Browse files
committed
Fix a gcc 11 warning in src/threadstate.c
When building under gcc 11, there is a warning about a misaligned guard clause because there were mixed spaces and tabs: ``` [128/634] Building C object src/CMakeFiles/git2internal.dir/threadstate.c.o ../src/threadstate.c: In function ‘threadstate_dispose’: ../src/threadstate.c:39:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 39 | if (threadstate->error_t.message != git_str__initstr) | ^~ ../src/threadstate.c:41:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 41 | threadstate->error_t.message = NULL; | ^~~~~~~~~~~ ../src/threadstate.c: At top level: ``` This change indents the code with tabs for consistency with the rest of the code, which makes the warning go away.
1 parent 043f312 commit 0c4d24d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/threadstate.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ static void threadstate_dispose(git_threadstate *threadstate)
3636
if (!threadstate)
3737
return;
3838

39-
if (threadstate->error_t.message != git_str__initstr)
40-
git__free(threadstate->error_t.message);
39+
if (threadstate->error_t.message != git_str__initstr)
40+
git__free(threadstate->error_t.message);
4141
threadstate->error_t.message = NULL;
4242
}
4343

0 commit comments

Comments
 (0)