summaryrefslogtreecommitdiff
path: root/platform/x11
diff options
context:
space:
mode:
Diffstat (limited to 'platform/x11')
-rw-r--r--platform/x11/godot_x11.cpp5
-rw-r--r--platform/x11/os_x11.cpp6
2 files changed, 6 insertions, 5 deletions
diff --git a/platform/x11/godot_x11.cpp b/platform/x11/godot_x11.cpp
index 3241cbcbf9..21148f8e86 100644
--- a/platform/x11/godot_x11.cpp
+++ b/platform/x11/godot_x11.cpp
@@ -43,7 +43,7 @@ int main(int argc, char *argv[]) {
setlocale(LC_CTYPE, "");
char *cwd = (char *)malloc(PATH_MAX);
- getcwd(cwd, PATH_MAX);
+ char *ret = getcwd(cwd, PATH_MAX);
Error err = Main::setup(argv[0], argc - 1, &argv[1]);
if (err != OK) {
@@ -55,7 +55,8 @@ int main(int argc, char *argv[]) {
os.run(); // it is actually the OS that decides how to run
Main::cleanup();
- chdir(cwd);
+ if (ret)
+ chdir(cwd);
free(cwd);
return os.get_exit_code();
diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp
index 5be0b9304a..7c4c8f0eff 100644
--- a/platform/x11/os_x11.cpp
+++ b/platform/x11/os_x11.cpp
@@ -1096,7 +1096,7 @@ void OS_X11::set_window_size(const Size2 p_size) {
int old_h = xwa.height;
// If window resizable is disabled we need to update the attributes first
- if (is_window_resizable() == false) {
+ if (!is_window_resizable()) {
XSizeHints *xsh;
xsh = XAllocSizeHints();
xsh->flags = PMinSize | PMaxSize;
@@ -1688,7 +1688,7 @@ void OS_X11::handle_key_event(XKeyEvent *p_event, bool p_echo) {
}
} else {
//ignore
- if (last_is_pressed == false) {
+ if (!last_is_pressed) {
return;
}
}
@@ -2814,7 +2814,7 @@ void OS_X11::run() {
#ifdef JOYDEV_ENABLED
joypad->process_joypads();
#endif
- if (Main::iteration() == true)
+ if (Main::iteration())
break;
};