Module Name:    src
Committed By:   sborrill
Date:           Fri Nov 27 09:19:13 UTC 2009

Modified Files:
        src/sys/kern [netbsd-5-0]: tty_subr.c

Log Message:
Pull up the following revisions(s) (requested by dsl in ticket #1141):
        sys/kern/tty_subr.c:    revision 1.38

Fix clrbits() so that it doesn't mask no bits out of the byte after the
range (when the last bit to be cleared is the msb of a byte).
Fixes PR/42312.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.34.8.1 src/sys/kern/tty_subr.c

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

Modified files:

Index: src/sys/kern/tty_subr.c
diff -u src/sys/kern/tty_subr.c:1.34 src/sys/kern/tty_subr.c:1.34.8.1
--- src/sys/kern/tty_subr.c:1.34	Wed Jul 16 18:27:49 2008
+++ src/sys/kern/tty_subr.c	Fri Nov 27 09:19:13 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: tty_subr.c,v 1.34 2008/07/16 18:27:49 drochner Exp $	*/
+/*	$NetBSD: tty_subr.c,v 1.34.8.1 2009/11/27 09:19:13 sborrill Exp $	*/
 
 /*
  * Copyright (c) 1993, 1994 Theo de Raadt
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tty_subr.c,v 1.34 2008/07/16 18:27:49 drochner Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tty_subr.c,v 1.34.8.1 2009/11/27 09:19:13 sborrill Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -316,10 +316,11 @@
 		return;
 	}
 
+	len--;
 	sby = off / NBBY;
 	sbi = off % NBBY;
 	eby = (off+len) / NBBY;
-	ebi = (off+len) % NBBY;
+	ebi = (off+len) % NBBY + 1;
 	if (sby == eby) {
 		mask = ((1 << (ebi - sbi)) - 1) << sbi;
 		cp[sby] &= ~mask;

Reply via email to