cleanup: Ensure that error codes are always initialised.

In this case, there was no way it would not be, but a code change down
the stack could cause a variable to become uninitialised. This avoids a
gcc warning and is more locally-correct.
This commit is contained in:
iphydf 2021-12-07 14:42:13 +00:00
parent 101e235131
commit 1ce6aab5da
No known key found for this signature in database
GPG Key ID: 3855DBA2D74403C9
2 changed files with 4 additions and 2 deletions

View File

@ -8,12 +8,13 @@ g++ -O3 -o /dev/null amalgamation.cc \
"${CPPFLAGS[@]}" \ "${CPPFLAGS[@]}" \
"${LDFLAGS[@]}" \ "${LDFLAGS[@]}" \
-std=c++11 \ -std=c++11 \
-pedantic \
-fdiagnostics-color=always \ -fdiagnostics-color=always \
-Wall \ -Wall \
-Wextra \ -Wextra \
-Wno-aggregate-return \ -Werror \
-Wno-aggressive-loop-optimizations \ -Wno-aggressive-loop-optimizations \
-Wno-error=null-dereference \
-Wno-error=type-limits \
-Wno-float-conversion \ -Wno-float-conversion \
-Wno-format-signedness \ -Wno-format-signedness \
-Wno-missing-field-initializers \ -Wno-missing-field-initializers \

View File

@ -1655,6 +1655,7 @@ bool tox_file_send_chunk(Tox *tox, uint32_t friend_number, uint32_t file_number,
} }
/* can't happen */ /* can't happen */
SET_ERROR_PARAMETER(error, TOX_ERR_FILE_SEND_CHUNK_OK);
return 0; return 0;
} }