fixed ntscript smartfind's bounds check

This commit is contained in:
Tastyfish
2012-03-15 20:23:49 -04:00
parent 0ca437690f
commit 1224d1da77

View File

@@ -101,13 +101,13 @@
if(haystack && needle)
if(isobject(haystack))
if(istype(haystack, /list))
if(length(haystack) >= end && start > 0)
if(length(haystack) + 1 >= end && start > 0)
var/list/listhaystack = haystack
return listhaystack.Find(needle, start, end)
else
if(istext(haystack))
if(length(haystack) >= end && start > 0)
if(length(haystack) + 1 >= end && start > 0)
return findtext(haystack, needle, start, end)
// Clone of copytext()