software/libbase: fix memcpy handling of buffers with differing alignments
This commit is contained in:
parent
4dbc938f7c
commit
48b70f09a8
|
@ -265,6 +265,13 @@ void *memcpy(void *to, const void *from, size_t n)
|
|||
from = cfrom;
|
||||
n--;
|
||||
}
|
||||
if((long)from & 1) {
|
||||
char *cto = to;
|
||||
const char *cfrom = from;
|
||||
for (; n; n--)
|
||||
*cto++ = *cfrom++;
|
||||
return xto;
|
||||
}
|
||||
if(n > 2 && (long)to & 2) {
|
||||
short *sto = to;
|
||||
const short *sfrom = from;
|
||||
|
|
Loading…
Reference in New Issue