mirror of
https://github.com/apache/nuttx.git
synced 2026-08-18 20:18:17 +00:00
When the 'c' parameter has bit 7 set (e.g. 0x80), the int value gets sign extended (to 0xffffff80 on the signed char platforms). The word sized fill pattern was built without truncating to unsigned char first, so the fast word aligned path wrote the wrong bytes. Fix both lib_memset.c and lib_bsdmemset.c by casting 'c' to unsigned char before building the fill pattern, as required by C11 7.24.6.1 which states that memset converts 'c' to unsigned char. Assisted-by: Claude:claude-opus-5 Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com> |
||
|---|---|---|
| .. | ||
| libbuiltin | ||
| libc | ||
| libdsp | ||
| libm | ||
| libnx | ||
| libxx | ||
| CMakeLists.txt | ||