From c394e79b95caaa2b0eb21241dacf5b7373cef887 Mon Sep 17 00:00:00 2001 From: Jeffrey Sharkey Date: Mon, 27 Oct 2008 15:58:43 +0000 Subject: * finished implementing copy functionality * added right or left alt- or shift- helping keys (/ and tab), disableable from settings * fixed a few random bugs --- src/de/mud/terminal/VDUBuffer.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/de/mud/terminal/VDUBuffer.java') diff --git a/src/de/mud/terminal/VDUBuffer.java b/src/de/mud/terminal/VDUBuffer.java index 120f093..60e7abf 100644 --- a/src/de/mud/terminal/VDUBuffer.java +++ b/src/de/mud/terminal/VDUBuffer.java @@ -33,7 +33,7 @@ import android.util.Log; * all methods to manipulate the buffer that stores characters and their * attributes as well as the regions displayed. * - * @author Matthias L. Jugel, Marcus Mei§ner + * @author Matthias L. Jugel, Marcus Meiner * @version $Id: VDUBuffer.java 503 2005-10-24 07:34:13Z marcus $ */ public class VDUBuffer { @@ -343,8 +343,10 @@ public class VDUBuffer { if (scrollDown) { if (n > (bottom - top)) n = (bottom - top); - cbuf = new char[bottom - l - (n - 1)][width]; - abuf = new int[bottom - l - (n - 1)][width]; + int size = bottom - l - (n - 1); + if(size < 0) size = 0; + cbuf = new char[size][width]; + abuf = new int[size][width]; System.arraycopy(charArray, oldBase + l, cbuf, 0, bottom - l - (n - 1)); System.arraycopy(charAttributes, oldBase + l, -- cgit v1.2.3