aboutsummaryrefslogtreecommitdiff
path: root/newlib/libc/string/strndup_r.c
diff options
context:
space:
mode:
authorEric Salem <ericsalem@gmail.com>2025-04-25 17:05:23 -0500
committerJeff Johnston <jjohnstn@redhat.com>2025-05-02 17:06:31 -0400
commit9bd586729930c4198ebdaa6b7e3fe4ed22b630f6 (patch)
tree2698c4bf6b7eb8b497f66e130457f4f51bf595e6 /newlib/libc/string/strndup_r.c
parente79484b219f0fa0f7202349963b8a653559525c0 (diff)
downloadnewlib-master.zip
newlib-master.tar.gz
newlib-master.tar.bz2
newlib: riscv: Remove unnecessary byte load for strlen()HEADmastermain
For architectures where XLEN is 32 bits, when detecting a null byte, a word is read at a time. Once a null is found in the word, its precise location is then determined. Make clear to the compiler that if the first three bytes are not null, the last byte must be null, and does not need to be read from the string, since its value is always zero. Reviewed-by: Christian Herber <christian.herber@oss.nxp.com> Signed-off-by: Eric Salem <ericsalem@gmail.com>
Diffstat (limited to 'newlib/libc/string/strndup_r.c')
0 files changed, 0 insertions, 0 deletions