Source-Changes-HG archive

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

[src/trunk]: src/lib/libc/string The number of byte pairs to swap is len/2, n...



details:   https://anonhg.NetBSD.org/src/rev/d656fc4078ca
branches:  trunk
changeset: 754060:d656fc4078ca
user:      apb <apb%NetBSD.org@localhost>
date:      Sun Apr 18 11:39:39 2010 +0000

description:
The number of byte pairs to swap is len/2, not len/2+1.

diffstat:

 lib/libc/string/swab.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r ae5b9386db2e -r d656fc4078ca lib/libc/string/swab.c
--- a/lib/libc/string/swab.c    Sun Apr 18 10:51:33 2010 +0000
+++ b/lib/libc/string/swab.c    Sun Apr 18 11:39:39 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: swab.c,v 1.16 2010/04/18 10:51:33 apb Exp $    */
+/*     $NetBSD: swab.c,v 1.17 2010/04/18 11:39:39 apb Exp $    */
 
 /*
  * Copyright (c) 1988, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)swab.c     8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: swab.c,v 1.16 2010/04/18 10:51:33 apb Exp $");
+__RCSID("$NetBSD: swab.c,v 1.17 2010/04/18 11:39:39 apb Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -57,7 +57,7 @@
        _DIAGASSERT(from != NULL);
        _DIAGASSERT(to != NULL);
 
-       len = (len / 2) + 1;
+       len /= 2;
        fp = (const char *)from;
        tp = (char *)to;
 #define        STEP    temp = *fp++,*tp++ = *fp++,*tp++ = temp



Home | Main Index | Thread Index | Old Index