From f36fa126de838bc2fd30cb9808f19d70f0726a57 Mon Sep 17 00:00:00 2001 From: kin4stat Date: Fri, 22 Nov 2024 17:50:23 +0300 Subject: [PATCH] Fix CRT_DEPRECATION warning --- c-api/data/discord_user.h | 6 +++--- c-api/data/vehicle_model_info.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/c-api/data/discord_user.h b/c-api/data/discord_user.h index 898ec8a..07c5591 100644 --- a/c-api/data/discord_user.h +++ b/c-api/data/discord_user.h @@ -16,15 +16,15 @@ struct ClrDiscordUser { auto usernameStr = discordManager->GetUsername(); username = new char[usernameStr.length() + 1]; - strcpy(username, usernameStr.c_str()); + strcpy_s(username, usernameStr.length() + 1, usernameStr.c_str()); auto discriminatorStr = discordManager->GetDiscriminator(); discriminator = new char[discriminatorStr.length() + 1]; - strcpy(discriminator, discriminatorStr.c_str()); + strcpy_s(discriminator, discriminatorStr.length() + 1, discriminatorStr.c_str()); auto avatarStr = discordManager->GetAvatar(); avatar = new char[avatarStr.length() + 1]; - strcpy(avatar, avatarStr.c_str()); + strcpy_s(avatar, avatarStr.length() + 1,avatarStr.c_str()); } ~ClrDiscordUser() { diff --git a/c-api/data/vehicle_model_info.h b/c-api/data/vehicle_model_info.h index ec0f4ca..3aceafe 100644 --- a/c-api/data/vehicle_model_info.h +++ b/c-api/data/vehicle_model_info.h @@ -54,7 +54,7 @@ struct ClrVehicleModelInfo } title = new char[info.title.length() + 1]; - strcpy(title, info.title.c_str()); + strcpy_s(title, info.title.length() + 1, info.title.c_str()); const auto vehModelBones = info.bones; boneSize = vehModelBones.size();