Skip to content
Closed
Show file tree
Hide file tree
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
9 changes: 8 additions & 1 deletion code/client/cl_cgame.c
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,14 @@ intptr_t CL_CgameSystemCalls( intptr_t *args ) {
Com_Memcpy( VMA(1), VMA(2), args[3] );
return 0;
case CG_STRNCPY:
strncpy( VMA(1), VMA(2), args[3] );
{
char *dest = VMA(1);
char *src = VMA(2);

if ( dest != src ) {
strncpy( dest, src, args[3] );
}
}
return args[1];
case CG_SIN:
return FloatAsInt( sin( VMF(1) ) );
Expand Down
9 changes: 8 additions & 1 deletion code/client/cl_ui.c
Original file line number Diff line number Diff line change
Expand Up @@ -1005,7 +1005,14 @@ intptr_t CL_UISystemCalls( intptr_t *args ) {
return 0;

case UI_STRNCPY:
strncpy( VMA(1), VMA(2), args[3] );
{
char *dest = VMA(1);
char *src = VMA(2);

if ( dest != src ) {
strncpy( dest, src, args[3] );
}
}
return args[1];

case UI_SIN:
Expand Down
9 changes: 8 additions & 1 deletion code/server/sv_game.c
Original file line number Diff line number Diff line change
Expand Up @@ -809,7 +809,14 @@ intptr_t SV_GameSystemCalls( intptr_t *args ) {
return 0;

case TRAP_STRNCPY:
strncpy( VMA(1), VMA(2), args[3] );
{
char *dest = VMA(1);
char *src = VMA(2);

if ( dest != src ) {
strncpy( dest, src, args[3] );
}
}
return args[1];

case TRAP_SIN:
Expand Down