Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/common/lib/libc/arch/arm/string write of final NUL in strlcp...



details:   https://anonhg.NetBSD.org/src/rev/e02036aaa482
branches:  trunk
changeset: 789502:e02036aaa482
user:      matt <matt%NetBSD.org@localhost>
date:      Tue Aug 20 21:37:39 2013 +0000

description:
write of final NUL in strlcpy doesn't need to be post-incremented

diffstat:

 common/lib/libc/arch/arm/string/strcpy_naive.S |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (21 lines):

diff -r 3195db24edf0 -r e02036aaa482 common/lib/libc/arch/arm/string/strcpy_naive.S
--- a/common/lib/libc/arch/arm/string/strcpy_naive.S    Tue Aug 20 21:35:24 2013 +0000
+++ b/common/lib/libc/arch/arm/string/strcpy_naive.S    Tue Aug 20 21:37:39 2013 +0000
@@ -28,7 +28,7 @@
  */
 #include <machine/asm.h>
 
-RCSID("$NetBSD: strcpy_naive.S,v 1.3 2013/08/11 05:02:35 matt Exp $")
+RCSID("$NetBSD: strcpy_naive.S,v 1.4 2013/08/20 21:37:39 matt Exp $")
 
 #ifdef _LIBC
 #ifdef STRLCPY
@@ -57,7 +57,7 @@
        bne     1b                      /*   no, do next byte */
        b       4f                      /*   yes, end of string, so return */
 2:     mov     r3, #0                  /* NUL */
-       strb    r3, [r0], #1            /* write to end of string */
+       strb    r3, [r0]                /* write to end of string */
 3:     ldrb    r3, [r1], #1            /* read a byte */
        teq     r3, #0                  /* was it a NUL? */
        bne     3b                      /*   no, get next byte */



Home | Main Index | Thread Index | Old Index