ENGINE-305: fixes for tchar ENGINE-305
authorkrista
Tue, 31 Oct 2017 12:03:26 +0100
branchENGINE-305
changeset 2223f88a2a9f2f75
parent 2222 1ab9f8ab0a1a
child 2224 e1529b69bab3
child 2226 a2fc17500b5c
ENGINE-305: fixes for tchar
src/platform_windows.cpp
     1.1 --- a/src/platform_windows.cpp	Tue Oct 31 11:18:23 2017 +0100
     1.2 +++ b/src/platform_windows.cpp	Tue Oct 31 12:03:26 2017 +0100
     1.3 @@ -18,6 +18,7 @@
     1.4  #include <stdexcept>
     1.5  #include "platform_windows.h"
     1.6  #include <fcntl.h>
     1.7 +#include <tchar.h>
     1.8  #include <sys\stat.h>
     1.9  
    1.10  #ifndef WC_ERR_INVALID_CHARS
    1.11 @@ -162,13 +163,8 @@
    1.12  
    1.13      if (module == NULL) {
    1.14          SetDllDirectory(NULL);
    1.15 -        
    1.16 -        int chars_remaining = PATH_BUF_SIZE - strlen(path) - 1;
    1.17 -        int add_len = strlen(TEXT("\\bin");
    1.18 -        if (add_len > chars_remaining)
    1.19 -            return NULL;
    1.20 -            
    1.21 -        strncat(path, TEXT("\\bin"), add_len);
    1.22 +                    
    1.23 +		_tcscat_s(path, TEXT("\\bin"));
    1.24          
    1.25          SetDllDirectory(TEXT(""));
    1.26          _result = SetDllDirectory(path);