diff --git a/src/config.c b/src/config.c index 13d0e8631a..313403297e 100644 --- a/src/config.c +++ b/src/config.c @@ -814,7 +814,7 @@ static void config_read_properties(config_section_definition **currentSection, c } else { if (*currentSection != NULL) { utf8 *propertyName, *value; - int propertyNameSize, valueSize; + int propertyNameSize = 0, valueSize; if (config_get_property_name_value(ch, &propertyName, &propertyNameSize, &value, &valueSize)) { config_property_definition *property; property = config_get_property_def(*currentSection, propertyName, propertyNameSize); diff --git a/src/localisation/localisation.c b/src/localisation/localisation.c index c89308c605..d383892707 100644 --- a/src/localisation/localisation.c +++ b/src/localisation/localisation.c @@ -672,7 +672,7 @@ static void format_comma_separated_fixed_1dp(char **dest, size_t *size, long lon char tmp; const char *commaMark = language_get_string(STR_LOCALE_THOUSANDS_SEPARATOR); const char *decimalMark = language_get_string(STR_LOCALE_DECIMAL_POINT); - const char *ch; + const char *ch = NULL; int zeroNeeded = 1; if ((*size) == 0) return; diff --git a/src/network/http.cpp b/src/network/http.cpp index dbb589a6af..09dc0f91f5 100644 --- a/src/network/http.cpp +++ b/src/network/http.cpp @@ -118,7 +118,7 @@ http_json_response *http_request_json(const http_json_request *request) CURL *curl; CURLcode curlResult; http_json_response *response; - read_buffer readBuffer; + read_buffer readBuffer = { 0 }; write_buffer writeBuffer; curl = curl_easy_init(); diff --git a/src/paint/map_element/surface.c b/src/paint/map_element/surface.c index 1ef953a3c4..e45e672984 100644 --- a/src/paint/map_element/surface.c +++ b/src/paint/map_element/surface.c @@ -336,9 +336,9 @@ static void viewport_surface_smoothen_edge(enum edge edge, struct tile_descripto return; } - uint32 maskImageBase; - uint8 neighbourCorners[2]; - uint8 ownCorners[2]; + uint32 maskImageBase = 0; + uint8 neighbourCorners[2] = { 0 }; + uint8 ownCorners[2] = { 0 }; switch (edge) { case EDGE_BOTTOMLEFT: @@ -376,7 +376,7 @@ static void viewport_surface_smoothen_edge(enum edge edge, struct tile_descripto return; } - uint8 dh, cl; + uint8 dh = 0, cl = 0; switch(edge) { case EDGE_BOTTOMLEFT: dh = byte_97B524[byte_97B444[self.slope]]; diff --git a/src/util/sawyercoding.c b/src/util/sawyercoding.c index ddb180e85a..4db38ba8c9 100644 --- a/src/util/sawyercoding.c +++ b/src/util/sawyercoding.c @@ -465,7 +465,7 @@ static size_t encode_chunk_repeat(const uint8 *src_buffer, uint8 *dst_buffer, si { size_t i, j, outLength; size_t searchIndex, searchEnd, maxRepeatCount; - size_t bestRepeatIndex, bestRepeatCount, repeatIndex, repeatCount; + size_t bestRepeatIndex = 0, bestRepeatCount = 0, repeatIndex, repeatCount; if (length == 0) return 0; diff --git a/src/windows/text_input.c b/src/windows/text_input.c index 2e45c53d78..7280eb8b4d 100644 --- a/src/windows/text_input.c +++ b/src/windows/text_input.c @@ -278,7 +278,7 @@ static void window_text_input_paint(rct_window *w, rct_drawpixelinfo *dpi) size_t char_count = 0; uint8 cur_drawn = 0; - int cursorX, cursorY; + int cursorX = 0, cursorY = 0; for (int line = 0; line <= no_lines; line++) { gfx_draw_string(dpi, wrap_pointer, w->colours[1], w->x + 12, y);