File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
include/chaiscript/language Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -150,8 +150,8 @@ namespace chaiscript
150150 return std::string (t_str.begin (), t_str.end ());
151151 }
152152
153- #ifdef _UNICODE
154- template <typename T>
153+ #if defined( _UNICODE) || defined(UNICODE)
154+ template <typename T>
155155 static std::wstring to_proper_string (const T &t_str)
156156 {
157157 return to_wstring (t_str);
@@ -166,7 +166,7 @@ namespace chaiscript
166166
167167 static std::string get_error_message (DWORD t_err)
168168 {
169- #ifdef _UNICODE
169+ #if defined( _UNICODE) || defined(UNICODE)
170170 typedef LPWSTR StringType;
171171 std::wstring retval = L" Unknown Error" ;
172172#else
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ char *mystrdup (const char *s) {
2424 char *d = static_cast <char *>(malloc (len+1 ));
2525 if (d == nullptr ) return nullptr ; // No memory
2626#ifdef CHAISCRIPT_MSVC
27- strcpy_s (d, len, s); // Copy the characters
27+ strcpy_s (d, len+ 1 , s); // Copy the characters
2828#else
2929 strncpy (d,s,len); // Copy the characters
3030#endif
You can’t perform that action at this time.
0 commit comments