summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorqarmin <mikrutrafal54@gmail.com>2019-07-07 23:08:51 +0200
committerqarmin <mikrutrafal54@gmail.com>2019-07-07 23:08:51 +0200
commit9a77d748c0d4e1c3dceb40216b9a345073032361 (patch)
tree3fef755e93df1df19207982deca39610d92c950f /platform
parentd897131ac555de84afe9ca6845abf87c26957895 (diff)
Fixes minor issues found by static analyzer
Diffstat (limited to 'platform')
-rw-r--r--platform/android/file_access_jandroid.cpp2
-rw-r--r--platform/x11/godot_x11.cpp1
2 files changed, 2 insertions, 1 deletions
diff --git a/platform/android/file_access_jandroid.cpp b/platform/android/file_access_jandroid.cpp
index 63bc5f69d1..5b8cf01138 100644
--- a/platform/android/file_access_jandroid.cpp
+++ b/platform/android/file_access_jandroid.cpp
@@ -62,7 +62,7 @@ Error FileAccessJAndroid::_open(const String &p_path, int p_mode_flags) {
JNIEnv *env = ThreadAndroid::get_env();
jstring js = env->NewStringUTF(path.utf8().get_data());
- int res = env->CallIntMethod(io, _file_open, js, p_mode_flags & WRITE ? true : false);
+ int res = env->CallIntMethod(io, _file_open, js, (p_mode_flags & WRITE) ? true : false);
env->DeleteLocalRef(js);
OS::get_singleton()->print("fopen: '%s' ret %i\n", path.utf8().get_data(), res);
diff --git a/platform/x11/godot_x11.cpp b/platform/x11/godot_x11.cpp
index 9baa4d6dca..755ef7a84f 100644
--- a/platform/x11/godot_x11.cpp
+++ b/platform/x11/godot_x11.cpp
@@ -43,6 +43,7 @@ int main(int argc, char *argv[]) {
setlocale(LC_CTYPE, "");
char *cwd = (char *)malloc(PATH_MAX);
+ ERR_FAIL_COND_V(!cwd, ERR_OUT_OF_MEMORY);
char *ret = getcwd(cwd, PATH_MAX);
Error err = Main::setup(argv[0], argc - 1, &argv[1]);