mirror of
https://github.com/UberGames/lilium-voyager.git
synced 2024-12-13 05:31:29 +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;
|
||||
}
|
||||
|
||||
void *memmove( void *dest, const void *src, size_t count ) {
|
||||
int i;
|
||||
void *memmove(void *dest, const void *src, size_t count)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
if ( dest > src ) {
|
||||
for ( i = count-1 ; i >= 0 ; i-- ) {
|
||||
((char *)dest)[i] = ((char *)src)[i];
|
||||
if(count)
|
||||
{
|
||||
if(dest > src)
|
||||
{
|
||||
i = count - 1;
|
||||
|
||||
do
|
||||
{
|
||||
((char *) dest)[i] = ((char *) src)[i];
|
||||
i--;
|
||||
} while(i > 0);
|
||||
}
|
||||
} else {
|
||||
for ( i = 0 ; i < count ; i++ ) {
|
||||
((char *)dest)[i] = ((char *)src)[i];
|
||||
else
|
||||
{
|
||||
for(i = 0; i < count; i++)
|
||||
((char *) dest)[i] = ((char *) src)[i];
|
||||
}
|
||||
}
|
||||
|
||||
return dest;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue