summaryrefslogtreecommitdiff
path: root/drivers/unix/dir_access_unix.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2018-10-07 15:23:38 +0200
committerGitHub <noreply@github.com>2018-10-07 15:23:38 +0200
commit5676632a3bb8562b3346a3afba4069501365b35f (patch)
tree79c0d2f4a5378a97535e35df18533d09066b1033 /drivers/unix/dir_access_unix.cpp
parentcff89fc4e4f2ceb577b5f7a119d98cb22d41ea44 (diff)
parentd65afb2c7474f4f7b19aacc74dd3956ee491c60b (diff)
Merge pull request #22788 from Faless/warnings_fix
Some warnings fix
Diffstat (limited to 'drivers/unix/dir_access_unix.cpp')
-rw-r--r--drivers/unix/dir_access_unix.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/unix/dir_access_unix.cpp b/drivers/unix/dir_access_unix.cpp
index 48b4369b7e..929e67faa9 100644
--- a/drivers/unix/dir_access_unix.cpp
+++ b/drivers/unix/dir_access_unix.cpp
@@ -309,7 +309,7 @@ Error DirAccessUnix::change_dir(String p_dir) {
// prev_dir is the directory we are changing out of
String prev_dir;
char real_current_dir_name[2048];
- getcwd(real_current_dir_name, 2048);
+ ERR_FAIL_COND_V(getcwd(real_current_dir_name, 2048) == NULL, ERR_BUG);
if (prev_dir.parse_utf8(real_current_dir_name))
prev_dir = real_current_dir_name; //no utf8, maybe latin?
@@ -330,7 +330,7 @@ Error DirAccessUnix::change_dir(String p_dir) {
// the directory exists, so set current_dir to try_dir
current_dir = try_dir;
- chdir(prev_dir.utf8().get_data());
+ ERR_FAIL_COND_V(chdir(prev_dir.utf8().get_data()) != 0, ERR_BUG);
return OK;
}
@@ -405,7 +405,7 @@ DirAccessUnix::DirAccessUnix() {
// set current directory to an absolute path of the current directory
char real_current_dir_name[2048];
- getcwd(real_current_dir_name, 2048);
+ ERR_FAIL_COND(getcwd(real_current_dir_name, 2048) == NULL);
if (current_dir.parse_utf8(real_current_dir_name))
current_dir = real_current_dir_name;