From 7ee6f7d0fa341b3dcc711ea3e2f0d9e7d95cef7b Mon Sep 17 00:00:00 2001 From: benfry Date: Thu, 1 Dec 2005 15:18:28 +0000 Subject: [PATCH] fix for bug #110, the AIOOBE on auto format --- app/tools/AutoFormat.java | 4 ++-- todo.txt | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/app/tools/AutoFormat.java b/app/tools/AutoFormat.java index 93abede6c..9ec443c73 100644 --- a/app/tools/AutoFormat.java +++ b/app/tools/AutoFormat.java @@ -194,7 +194,7 @@ public class AutoFormat { c = string[j++] = getchr(); // extra char while (done == 0) { c = string[j++] = getchr(); - while(c != '/') { + while ((c != '/') && (j < string.length)) { if(c == '\n' || c == '\r') { lineNumber++; putcoms(); @@ -1008,4 +1008,4 @@ public class AutoFormat { } return (1); } -} \ No newline at end of file +} diff --git a/todo.txt b/todo.txt index a3e7fe827..9000f7506 100644 --- a/todo.txt +++ b/todo.txt @@ -12,9 +12,12 @@ X subclasses need to use "public void keyPressed" not "void keyPressed" X tweak linux version shell script to properly set directory name X http://dev.processing.org/bugs/show_bug.cgi?id=234 -_ bugs in auto-format -_ if an error occurs during format, report it and don't change text -_ http://processing.org/discourse/yabb_beta/YaBB.cgi?board=SoftwareBugs;action=display;num=1117081646 +bugs in auto-format +X ArrayIndexOutOfBoundsException when trying to Auto Format +X http://dev.processing.org/bugs/show_bug.cgi?id=110 +_ autoformat mangling code +_ http://dev.processing.org/bugs/show_bug.cgi?id=109 +_ if an error occurs during format, report it and don't change text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .