Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove strcpy #679

Merged
merged 1 commit into from
Dec 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion ocgapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,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