Skip to content

Commit

Permalink
remove strcpy (#679)
Browse files Browse the repository at this point in the history
  • Loading branch information
salix5 authored Dec 3, 2024
1 parent 66c117d commit 1af2619
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ocgapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,9 @@ extern "C" DECL_DLLEXPORT void set_player_info(intptr_t pduel, int32 playerid, i
pd->game_field->player[playerid].draw_count = drawcount;
}
extern "C" DECL_DLLEXPORT void get_log_message(intptr_t pduel, char* buf) {
std::strcpy(buf, ((duel*)pduel)->strbuffer);
duel* pd = (duel*)pduel;
buf[0] = '\0';
std::strncat(buf, pd->strbuffer, sizeof pd->strbuffer - 1);
}
extern "C" DECL_DLLEXPORT int32 get_message(intptr_t pduel, byte* buf) {
int32 len = ((duel*)pduel)->read_buffer(buf);
Expand Down

0 comments on commit 1af2619

Please sign in to comment.