mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Fixed c4996 compiler warning/error due to use of strncpy
This commit is contained in:
parent
a8846e92ee
commit
2309a52671
@ -13,6 +13,7 @@
|
|||||||
|
|
||||||
#include "shared.hpp"
|
#include "shared.hpp"
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <string>
|
#include <string>
|
||||||
@ -56,23 +57,16 @@ std::string addLineBreaks(const std::vector<std::string> &words) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return sstream.str();
|
return sstream.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
// i like to live dangerously. jk, fix strncpy sometime pls.
|
|
||||||
#pragma warning( push )
|
|
||||||
#pragma warning( disable : 4996 )
|
|
||||||
|
|
||||||
void __stdcall RVExtension(char *output, int outputSize, const char *function) {
|
void __stdcall RVExtension(char *output, int outputSize, const char *function) {
|
||||||
ZERO_OUTPUT();
|
ZERO_OUTPUT();
|
||||||
if (!strcmp(function, "version")) {
|
if (!strcmp(function, "version")) {
|
||||||
strncpy(output, ACE_FULL_VERSION_STR, outputSize);
|
strncpy_s(output, outputSize, ACE_FULL_VERSION_STR, _TRUNCATE);
|
||||||
} else {
|
} else {
|
||||||
strncpy(output, addLineBreaks(splitString(function)).c_str(), outputSize);
|
strncpy_s(output, outputSize, addLineBreaks(splitString(function)).c_str(), _TRUNCATE);
|
||||||
output[outputSize - 1] = '\0';
|
|
||||||
}
|
}
|
||||||
EXTENSION_RETURN();
|
EXTENSION_RETURN();
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma warning( pop )
|
|
||||||
|
Loading…
Reference in New Issue
Block a user