summaryrefslogtreecommitdiff
path: root/modules/mono/utils/string_utils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/mono/utils/string_utils.cpp')
-rw-r--r--modules/mono/utils/string_utils.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/modules/mono/utils/string_utils.cpp b/modules/mono/utils/string_utils.cpp
index 0ef66577fe..877122985d 100644
--- a/modules/mono/utils/string_utils.cpp
+++ b/modules/mono/utils/string_utils.cpp
@@ -33,6 +33,7 @@
#include "core/os/file_access.h"
#include <stdio.h>
+#include <stdlib.h>
namespace {
@@ -65,7 +66,7 @@ int sfind(const String &p_text, int p_from) {
break;
case 1: {
CharType c = src[read_pos];
- found = src[read_pos] == 's' || (c >= '0' || c <= '4');
+ found = src[read_pos] == 's' || (c >= '0' && c <= '4');
break;
}
default:
@@ -209,8 +210,8 @@ String str_format(const char *p_format, ...) {
#endif
#endif
-#if defined(MINGW_ENABLED) || defined(_MSC_VER)
-#define vsnprintf vsnprintf_s
+#if defined(MINGW_ENABLED) || defined(_MSC_VER) && _MSC_VER < 1900
+#define vsnprintf(m_buffer, m_count, m_format, m_argptr) vsnprintf_s(m_buffer, m_count, _TRUNCATE, m_format, m_argptr)
#endif
String str_format(const char *p_format, va_list p_list) {