summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordscho <dscho>2004-01-19 17:34:25 +0000
committerdscho <dscho>2004-01-19 17:34:25 +0000
commit6e7aa909e9f4dc03038228fa15942bd3adc87b77 (patch)
tree27203f1cfd6c23b63d726f8fcd87b87f4a5093f3
parent15f3a61eb5b9256c42a400d47f96da4174fd5fc3 (diff)
downloadlibtdevnc-6e7aa909.tar.gz
libtdevnc-6e7aa909.zip
fix usage of non-existent attribute buffer
-rw-r--r--vncterm/VNConsole.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/vncterm/VNConsole.c b/vncterm/VNConsole.c
index a5f1ecb..23da1b0 100644
--- a/vncterm/VNConsole.c
+++ b/vncterm/VNConsole.c
@@ -171,9 +171,10 @@ void vcScroll(vncConsolePtr c,int lineCount)
c->screenBuffer+(c->height-lineCount)*c->width,
(c->height-lineCount)*c->width);
#ifdef USE_ATTRIBUTE_BUFFER
- memmove(c->attributeBuffer,
- c->attributeBuffer+(c->height-lineCount)*c->width,
- (c->height-lineCount)*c->width);
+ if(c->attributeBuffer)
+ memmove(c->attributeBuffer,
+ c->attributeBuffer+(c->height-lineCount)*c->width,
+ (c->height-lineCount)*c->width);
#endif
} else {
y1=0; y2=-lineCount*c->cHeight;
@@ -182,9 +183,10 @@ void vcScroll(vncConsolePtr c,int lineCount)
c->screenBuffer,
(c->height+lineCount)*c->width);
#ifdef USE_ATTRIBUTE_BUFFER
- memmove(c->attributeBuffer-lineCount*c->width,
- c->attributeBuffer,
- (c->height+lineCount)*c->width);
+ if(c->attributeBuffer)
+ memmove(c->attributeBuffer-lineCount*c->width,
+ c->attributeBuffer,
+ (c->height+lineCount)*c->width);
#endif
}
@@ -194,8 +196,9 @@ void vcScroll(vncConsolePtr c,int lineCount)
memset(c->screenBuffer+y1/c->cHeight*c->width,' ',
(y2-y1)/c->cHeight*c->width);
#ifdef USE_ATTRIBUTE_BUFFER
- memset(c->attributeBuffer+y1/c->cHeight*c->width,0x07,
- (y2-y1)/c->cHeight*c->width);
+ if(c->attributeBuffer)
+ memset(c->attributeBuffer+y1/c->cHeight*c->width,0x07,
+ (y2-y1)/c->cHeight*c->width);
#endif
/* rfbLog("end scroll\n"); */
}