diff options
Diffstat (limited to 'libc')
-rw-r--r-- | libc/string/arm/strncmp.S | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libc/string/arm/strncmp.S b/libc/string/arm/strncmp.S index 39344db75..46f5f5092 100644 --- a/libc/string/arm/strncmp.S +++ b/libc/string/arm/strncmp.S @@ -35,10 +35,11 @@ .align 4 strncmp: - /* if ((len - 1) < 0) return 0 */ + /* if (len == 0) return 0 */ + cmp r2, #0 + moveq r0, #0 + moveq pc, lr subs r2, r2, #1 - movmi r0, #0 - movmi pc, lr /* ip == last src address to compare */ add ip, r0, r2 |