From 4d2db01a0f0440701f2cf72a60739d6b79f2aeda Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Sun, 30 Jul 2023 22:03:12 +0100 Subject: [PATCH] Fix maybe uninitialised warning in DrawDeparturesListItems --- src/departures_gui.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/departures_gui.cpp b/src/departures_gui.cpp index c214d0c0713..0308f4201c0 100644 --- a/src/departures_gui.cpp +++ b/src/departures_gui.cpp @@ -876,7 +876,7 @@ void DeparturesWindow::DrawDeparturesListItems(const Rect &r) const } } - char buf[256]; + char buf[256] = ""; int64 args_array[] = { Waypoint::IsValidID(id) ? STR_WAYPOINT_NAME : STR_STATION_NAME, id, icon_via }; StringParameters tmp_params(args_array); char *end = GetStringWithArgs(buf, STR_DEPARTURES_VIA_DESCRIPTOR, &tmp_params, lastof(buf)); @@ -887,7 +887,7 @@ void DeparturesWindow::DrawDeparturesListItems(const Rect &r) const if (via2 != INVALID_STATION) { get_single_via_string(1, via2); - char buf[512]; + char buf[512] = ""; int64 args_array[] = { SPECSTR_TEMP_START, SPECSTR_TEMP_START + 1 }; StringParameters tmp_params(args_array); char *end = GetStringWithArgs(buf, STR_DEPARTURES_VIA_AND, &tmp_params, lastof(buf));