diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-10-05 11:42:47 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-10-05 11:42:47 +0200 |
commit | 5b6ccf2fd2c0e01481bad47d4403e7173476bfe2 (patch) | |
tree | 9b12a6a603d21f6e0feee43a7c06f031e0fd284d /platform | |
parent | 33f4c5282f3f6f64cd97c30978d130b6efbc94ce (diff) | |
parent | 2233624152a3b041daeab8b0fd88a2061b7b8565 (diff) |
Merge pull request #66720 from qarmin/unintialized_memory
Remove usage of unitialized variables
Diffstat (limited to 'platform')
-rw-r--r-- | platform/linuxbsd/crash_handler_linuxbsd.cpp | 2 | ||||
-rw-r--r-- | platform/linuxbsd/display_server_x11.cpp | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/platform/linuxbsd/crash_handler_linuxbsd.cpp b/platform/linuxbsd/crash_handler_linuxbsd.cpp index 33da094860..8c8c8588b8 100644 --- a/platform/linuxbsd/crash_handler_linuxbsd.cpp +++ b/platform/linuxbsd/crash_handler_linuxbsd.cpp @@ -89,7 +89,7 @@ static void handle_crash(int sig) { // Try to demangle the function name to provide a more readable one if (dladdr(bt_buffer[i], &info) && info.dli_sname) { if (info.dli_sname[0] == '_') { - int status; + int status = 0; char *demangled = abi::__cxa_demangle(info.dli_sname, nullptr, nullptr, &status); if (status == 0 && demangled) { diff --git a/platform/linuxbsd/display_server_x11.cpp b/platform/linuxbsd/display_server_x11.cpp index 1ef1deb971..5256d91a80 100644 --- a/platform/linuxbsd/display_server_x11.cpp +++ b/platform/linuxbsd/display_server_x11.cpp @@ -3142,7 +3142,7 @@ void DisplayServerX11::_window_changed(XEvent *event) { { //the position in xconfigure is not useful here, obtain it manually - int x, y; + int x = 0, y = 0; Window child; XTranslateCoordinates(x11_display, wd.x11_window, DefaultRootWindow(x11_display), 0, 0, &x, &y, &child); new_rect.position.x = x; @@ -3305,7 +3305,7 @@ void DisplayServerX11::_check_pending_events(LocalVector<XEvent> &r_events) { XFlush(x11_display); // Non-blocking wait for next event and remove it from the queue. - XEvent ev; + XEvent ev = {}; while (XCheckIfEvent(x11_display, &ev, _predicate_all_events, nullptr)) { // Check if the input manager wants to process the event. if (XFilterEvent(&ev, None)) { |