summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--newlib/libc/machine/arm/memchr.S3
1 files changed, 2 insertions, 1 deletions
diff --git a/newlib/libc/machine/arm/memchr.S b/newlib/libc/machine/arm/memchr.S
index b5dcf83c0..7c22b117e 100644
--- a/newlib/libc/machine/arm/memchr.S
+++ b/newlib/libc/machine/arm/memchr.S
@@ -135,10 +135,11 @@ memchr:
/* Use a simple loop if there are less than 8 bytes to search. */
cmp cntin, #7
bhi .Llargestr
+ and chrin, chrin, #0xff
.Lsmallstr:
subs cntin, cntin, #1
- blt .Lnotfound /* Return not found if reached end. */
+ blo .Lnotfound /* Return not found if reached end. */
ldrb tmp, [srcin], #1
cmp tmp, chrin
bne .Lsmallstr /* Loop again if not found. */