From f69bb9cc3e90ca11314026ff7244d7be26c61d45 Mon Sep 17 00:00:00 2001 From: benfry Date: Sun, 19 Dec 2004 00:20:37 +0000 Subject: [PATCH] tweak for potential obscure bug in quicksort font char lookup --- processing/core/PFont.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/processing/core/PFont.java b/processing/core/PFont.java index e73405a57..fc8741cc1 100644 --- a/processing/core/PFont.java +++ b/processing/core/PFont.java @@ -261,6 +261,10 @@ public class PFont implements PConstants { * @return index into arrays or -1 if not found */ public int index(char c) { + // degenerate case, but the find function will have trouble + // if there are somehow zero chars in the lookup + if (value.length == 0) return -1; + // these chars required in all fonts //if ((c >= 33) && (c <= 126)) { //return c - 33;