Module Name:    src
Committed By:   apb
Date:           Sun Apr 18 11:39:39 UTC 2010

Modified Files:
        src/lib/libc/string: swab.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/lib/libc/string/swab.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/string/swab.c
diff -u src/lib/libc/string/swab.c:1.16 src/lib/libc/string/swab.c:1.17
--- src/lib/libc/string/swab.c:1.16	Sun Apr 18 10:51:33 2010
+++ src/lib/libc/string/swab.c	Sun Apr 18 11:39:39 2010
@@ -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

Reply via email to