mirror of
https://github.com/glest/glest-source.git
synced 2025-10-04 11:21:36 +02:00
- How i love you microsoft... another win32 fix
This commit is contained in:
@@ -18,6 +18,7 @@
|
|||||||
#include "vec.h"
|
#include "vec.h"
|
||||||
|
|
||||||
using std::string;
|
using std::string;
|
||||||
|
using std::min;
|
||||||
using Shared::Platform::int8;
|
using Shared::Platform::int8;
|
||||||
using Shared::Platform::uint8;
|
using Shared::Platform::uint8;
|
||||||
using Shared::Platform::int16;
|
using Shared::Platform::int16;
|
||||||
@@ -43,7 +44,7 @@ public:
|
|||||||
void operator=(const string& str) {
|
void operator=(const string& str) {
|
||||||
// ensure we don't have a buffer overflow
|
// ensure we don't have a buffer overflow
|
||||||
int maxBufferSize = sizeof(buffer) / sizeof(buffer[0]);
|
int maxBufferSize = sizeof(buffer) / sizeof(buffer[0]);
|
||||||
strncpy(buffer, str.c_str(), std::min(S-1,maxBufferSize-1));
|
strncpy(buffer, str.c_str(), min(S-1,maxBufferSize-1));
|
||||||
}
|
}
|
||||||
string getString() const {return buffer;}
|
string getString() const {return buffer;}
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user