Files
heimdal/appl/ftp/common/memmove.c
Unknown User d91-jda 7686c38ea0 Version 0.0
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@387 ec53bebd-3082-4978-b11e-865c3cabbd6b
1996-04-08 22:51:40 +00:00

34 lines
411 B
C

/*
* memmove for systems that doesn't have it
*
* $Id$
*
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <sys/types.h>
RCSID("$Id$");
void* memmove(void *s1, const void *s2, size_t n)
{
char *s=(char*)s2, *d=(char*)s1;
if(d > s){
s+=n-1;
d+=n-1;
while(n){
*d--=*s--;
n--;
}
}else if(d < s)
while(n){
*d++=*s++;
n--;
}
return s1;
}