Skip to content

Commit

Permalink
Changed Q_strcpy() to memmove()
Browse files Browse the repository at this point in the history
  • Loading branch information
meag committed Sep 24, 2015
1 parent 98b1936 commit 6d4ce23
Showing 1 changed file with 1 addition and 21 deletions.
22 changes: 1 addition & 21 deletions info.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,6 @@ Manipulation with various info strings

#include "qtv.h"

// Taken from ezquake-source/q_shared.c
// like strcpy, but allow overlapping strings
char *Q_strcpy( char *to, char *from )
{
int i;

if (to < from) {
for (i = 0; from[i] != 0; i++) {
to[i] = from[i];
}
to[i] = from[i];
} else {
for (i = strlen(from); i >= 0; i--) {
to[i] = from[i];
}
}

return to;
}

//Cvar system calls this when a CVAR_SERVERINFO cvar changes
void SV_ServerinfoChanged (char *key, char *string)
{
Expand Down Expand Up @@ -128,7 +108,7 @@ void Info_RemoveKey (char *s, const char *key)

if (!strcmp (key, pkey))
{
Q_strcpy (start, s); // FIXME: remove this part
memmove(start, s, strlen(s) + 1);
return;
}

Expand Down

0 comments on commit 6d4ce23

Please sign in to comment.