aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorherp <>2000-06-04 21:43:50 +0000
committerherp <>2000-06-04 21:43:50 +0000
commite5e83f5c812c2976354bb2293f86ca72aab92bc9 (patch)
treef9555ca7a478ccb7c78bec7a7aa521443c7a4e60
parent13959d11ec74c762a55c7f2ca26ca0ab4245d58e (diff)
downloadlcd4linux-e5e83f5c812c2976354bb2293f86ca72aab92bc9.tar.gz
[lcd4linux @ 2000-06-04 21:43:50 by herp]
minor bugfix (zero length)
Diffstat (limited to '')
-rw-r--r--Crystalfontz.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/Crystalfontz.c b/Crystalfontz.c
index 0f778f0..09d41d1 100644
--- a/Crystalfontz.c
+++ b/Crystalfontz.c
@@ -1,4 +1,5 @@
-/*
+/* $Id: Crystalfontz.c,v 1.3 2000/06/04 21:43:50 herp Exp $
+ *
* driver for display modules from Crystalfontz
*
* Copyright 2000 by Herbert Rosmanith (herp@wildsau.idv.uni-linz.ac.at)
@@ -17,6 +18,11 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
+ * $Log: Crystalfontz.c,v $
+ * Revision 1.3 2000/06/04 21:43:50 herp
+ * minor bugfix (zero length)
+ *
+ *
*/
#include <stdio.h>
@@ -220,6 +226,7 @@ static unsigned char p2[] = { 0x00,0x20,0x30,0x38,0x3c,0x3e,0x3f };
static void blacken(int bitfrom,int len,int pos,int startbyte,int endbyte) {
+ if (len<1) return;
if (startbyte==endbyte)
Barbuf[pos] |=
(p1[bitfrom%XRES] & p2[1+((bitfrom+len-1)%XRES)]);
@@ -229,12 +236,12 @@ static void blacken(int bitfrom,int len,int pos,int startbyte,int endbyte) {
n=endbyte-startbyte-1;
if (n>0) memset(Barbuf+pos+1,0x3f,n);
Barbuf[pos+n+1] |= p2[1+((bitfrom+len-1)%XRES)];
-
}
}
static void whiten(int bitfrom,int len,int pos,int startbyte,int endbyte) {
+ if (len<1) return;
if (startbyte==endbyte)
Barbuf[pos] &=
(p2[bitfrom%XRES] | p1[1+((bitfrom+len-1)%XRES)]);