Use memmove() instead of memcpy() for copying of data between overlapping memory areas.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3534 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
03cb51a236
commit
bde4965f59
2 changed files with 3 additions and 2 deletions
|
@ -309,7 +309,7 @@ start:
|
|||
{
|
||||
i++;
|
||||
cmd_text[level].buf.cursize -= i;
|
||||
Q_memcpy (text, text+i, cmd_text[level].buf.cursize);
|
||||
Q_memmove (text, text+i, cmd_text[level].buf.cursize);
|
||||
}
|
||||
|
||||
// Con_Printf("Found \"%s\"\n", line);
|
||||
|
@ -387,7 +387,7 @@ void Cbuf_ExecuteLevel (int level)
|
|||
{
|
||||
i++;
|
||||
cmd_text[level].buf.cursize -= i;
|
||||
Q_memcpy (text, text+i, cmd_text[level].buf.cursize);
|
||||
Q_memmove (text, text+i, cmd_text[level].buf.cursize);
|
||||
}
|
||||
|
||||
// execute the command line
|
||||
|
|
|
@ -178,6 +178,7 @@ int wildcmp(const char *wild, const char *string); //1 if match
|
|||
|
||||
#define Q_memset(d, f, c) memset((d), (f), (c))
|
||||
#define Q_memcpy(d, s, c) memcpy((d), (s), (c))
|
||||
#define Q_memmove(d, s, c) memmove((d), (s), (c))
|
||||
#define Q_memcmp(m1, m2, c) memcmp((m1), (m2), (c))
|
||||
#define Q_strcpy(d, s) strcpy((d), (s))
|
||||
#define Q_strncpy(d, s, n) strncpy((d), (s), (n))
|
||||
|
|
Loading…
Reference in a new issue