mirror of
https://github.com/ioquake/ioq3.git
synced 2024-11-10 07:11:46 +00:00
Fix memmove with new size_t typedef, thanks DevHC for reporting
This commit is contained in:
parent
eb11388cac
commit
c257dc2cfa
1 changed files with 19 additions and 8 deletions
|
@ -272,18 +272,29 @@ int toupper( int c ) {
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
void *memmove( void *dest, const void *src, size_t count ) {
|
void *memmove(void *dest, const void *src, size_t count)
|
||||||
int i;
|
{
|
||||||
|
size_t i;
|
||||||
|
|
||||||
if ( dest > src ) {
|
if(count)
|
||||||
for ( i = count-1 ; i >= 0 ; i-- ) {
|
{
|
||||||
((char *)dest)[i] = ((char *)src)[i];
|
if(dest > src)
|
||||||
|
{
|
||||||
|
i = count - 1;
|
||||||
|
|
||||||
|
do
|
||||||
|
{
|
||||||
|
((char *) dest)[i] = ((char *) src)[i];
|
||||||
|
i--;
|
||||||
|
} while(i > 0);
|
||||||
}
|
}
|
||||||
} else {
|
else
|
||||||
for ( i = 0 ; i < count ; i++ ) {
|
{
|
||||||
((char *)dest)[i] = ((char *)src)[i];
|
for(i = 0; i < count; i++)
|
||||||
|
((char *) dest)[i] = ((char *) src)[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return dest;
|
return dest;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue