Browse Source

make sure we treat count as size_t, not ssize_t ... fixes with help from khem

Mike Frysinger 19 years ago
parent
commit
1e509af17b
1 changed files with 4 additions and 3 deletions
  1. 4 3
      libc/string/arm/strncmp.S

+ 4 - 3
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