diff options
Diffstat (limited to 'drivers/unix')
-rw-r--r-- | drivers/unix/file_access_unix.cpp | 2 | ||||
-rw-r--r-- | drivers/unix/thread_posix.cpp | 4 |
2 files changed, 6 insertions, 0 deletions
diff --git a/drivers/unix/file_access_unix.cpp b/drivers/unix/file_access_unix.cpp index 6b24a85ff6..31ec9d4c93 100644 --- a/drivers/unix/file_access_unix.cpp +++ b/drivers/unix/file_access_unix.cpp @@ -240,6 +240,8 @@ uint8_t FileAccessUnix::get_8() const { } int FileAccessUnix::get_buffer(uint8_t *p_dst, int p_length) const { + ERR_FAIL_COND_V(!p_dst, -1); + ERR_FAIL_COND_V(p_length < 0, -1); ERR_FAIL_COND_V_MSG(!f, -1, "File must be opened before use."); int read = fread(p_dst, 1, p_length, f); check_errors(); diff --git a/drivers/unix/thread_posix.cpp b/drivers/unix/thread_posix.cpp index 19fab1d475..e47046e3ae 100644 --- a/drivers/unix/thread_posix.cpp +++ b/drivers/unix/thread_posix.cpp @@ -35,6 +35,10 @@ #include "core/os/thread.h" #include "core/string/ustring.h" +#ifdef PTHREAD_BSD_SET_NAME +#include <pthread_np.h> +#endif + static Error set_name(const String &p_name) { #ifdef PTHREAD_NO_RENAME return ERR_UNAVAILABLE; |