]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/kern/tty_subr.c
xnu-2782.40.9.tar.gz
[apple/xnu.git] / bsd / kern / tty_subr.c
index c2abc010d4b27efe015519b7ebab728970f56a2e..89bc09fe04fcaabf91e9eba0c871e84cce8ab8b4 100644 (file)
@@ -340,7 +340,9 @@ clrbits(u_char *cp, int off, int len)
                cp[sby++] &= mask;
 
                mask = (1<<ebi) - 1;
-               cp[eby] &= ~mask;
+               /* handle remainder bits, if any, for a non-0 ebi value */
+               if (mask)
+                       cp[eby] &= ~mask;
 
                for (i = sby; i < eby; i++)
                        cp[i] = 0x00;