Permalink
Browse files

Added a gag to prevent crashes on parsing errors

  • Loading branch information...
1 parent 7e9c731 commit 0e0b19c905d58f6795a57f8042a958a76dec7f60 @alexander-yakushev committed Nov 30, 2010
Showing with 4 additions and 0 deletions.
  1. +4 −0 utf8.lua
View
@@ -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)

0 comments on commit 0e0b19c

Please sign in to comment.