forked from auracaster/openocd
- correctly mask out bits that aren't part of a copied buffer
- fixed arm926ej-s CP15 register access handling - correctly identify SYSCLK source in LPC3180 NAND flash controller driver git-svn-id: svn://svn.berlios.de/openocd/trunk@139 b42882b7-edfa-0310-969c-e2dbd0fdcd60
This commit is contained in:
@@ -101,6 +101,12 @@ u8* buf_cpy(u8 *from, u8 *to, int size)
|
||||
|
||||
for (i = 0; i < num_bytes; i++)
|
||||
to[i] = from[i];
|
||||
|
||||
/* mask out bits that don't belong to the buffer */
|
||||
if (size % 8)
|
||||
{
|
||||
to[size / 8] &= (0xff >> (8 - (size % 8)));
|
||||
}
|
||||
|
||||
return to;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user