aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Yakushev <yakushev.alex@gmail.com>2010-11-30 07:32:37 +0200
committerAlexander Yakushev <yakushev.alex@gmail.com>2010-11-30 07:32:37 +0200
commit0e0b19c905d58f6795a57f8042a958a76dec7f60 (patch)
treecd3b03ed9bdf39feb0a26be536952ff1faf6fbd9
parent7e9c7310ed8311d782216db211b359148af9d41c (diff)
downloadawesompd-0e0b19c905d58f6795a57f8042a958a76dec7f60.tar.gz
awesompd-0e0b19c905d58f6795a57f8042a958a76dec7f60.tar.bz2
Added a gag to prevent crashes on parsing errors
-rw-r--r--utf8.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/utf8.lua b/utf8.lua
index 3db6642..72177c2 100644
--- a/utf8.lua
+++ b/utf8.lua
@@ -100,6 +100,10 @@ end
-- instead of bytes
function utf8sub (s, i, j)
j = j or -1
+
+ if i == nil then
+ return ""
+ end
local pos = 1
local bytes = string.len(s)