Changes in boot/generic/src/memstr.c [de1712e:a35b458] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
boot/generic/src/memstr.c
rde1712e ra35b458 46 46 uint8_t *dp = (uint8_t *) dst; 47 47 const uint8_t *sp = (uint8_t *) src; 48 48 49 49 while (cnt-- != 0) 50 50 *dp++ = *sp++; 51 51 52 52 return dst; 53 53 } … … 67 67 { 68 68 uint8_t *dp = (uint8_t *) dst; 69 69 70 70 while (cnt-- != 0) 71 71 *dp++ = val; 72 72 73 73 return dst; 74 74 } … … 91 91 if (src == dst) 92 92 return dst; 93 93 94 94 /* Non-overlapping? */ 95 95 if ((dst >= src + cnt) || (src >= dst + cnt)) 96 96 return memcpy(dst, src, cnt); 97 97 98 98 uint8_t *dp; 99 99 const uint8_t *sp; 100 100 101 101 /* Which direction? */ 102 102 if (src > dst) { … … 104 104 dp = dst; 105 105 sp = src; 106 106 107 107 while (cnt-- != 0) 108 108 *dp++ = *sp++; … … 111 111 dp = dst + (cnt - 1); 112 112 sp = src + (cnt - 1); 113 113 114 114 while (cnt-- != 0) 115 115 *dp-- = *sp--; 116 116 } 117 117 118 118 return dst; 119 119 }
Note:
See TracChangeset
for help on using the changeset viewer.