diff options
Diffstat (limited to 'libc/string/arm/strncmp.S')
| -rw-r--r-- | libc/string/arm/strncmp.S | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/libc/string/arm/strncmp.S b/libc/string/arm/strncmp.S index 6f478b5ed..46f5f5092 100644 --- a/libc/string/arm/strncmp.S +++ b/libc/string/arm/strncmp.S @@ -29,16 +29,17 @@ * by Erik Andersen <andersen@codepoet.org> */ - .text - .global strncmp; - .type strncmp,%function - .align 4; \ +.text +.global strncmp +.type strncmp,%function +.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 |
