Fix more crossplat issues

This commit is contained in:
F1ssi0N 2018-03-13 20:24:41 +00:00
parent b542f59bd1
commit 4096976ea9
3 changed files with 11 additions and 4 deletions

View File

@ -291,10 +291,11 @@ void ConvarBase::tf_convar_changed(sdk::IConVar *iconvar, const char *old_string
ConvarBase::ConvarBase(const char *name, ConvarType type, const ConvarBase *parent) : parent(parent), t(type), next(head), init_complete(false) {
head = this;
if constexpr (doghook_platform_windows())
strcpy_s(internal_name, name);
else if constexpr (doghook_platform_linux())
strcpy(internal_name, name);
#if doghook_platform_windows()
strcpy_s(internal_name, name);
#elif doghook_platform_linux()
strcpy(internal_name, name);
#endif
// Create a tf convar based on this one
tf_convar = new sdk::ConCommandBase;

View File

@ -300,7 +300,12 @@ public:
auto size = strlen(str) + 1;
value = new char[size];
#if doghook_platform_windows()
strcpy_s(this->value, size, str);
#elif doghook_platform_linux()
strncpy(this->value, size, str);
#endif
return false;
}

View File

@ -239,6 +239,7 @@ public:
auto get_verified_user_cmd(u32 sequence_number) -> class VerifiedCmd * {
// 03 B7 ? ? ? ? 8D 04 88
return nullptr;
}
};