Explorar el Código

Fix substr on empty string

Pascal Peridont hace 19 años
padre
commit
3e38ac361e
Se han modificado 1 ficheros con 1 adiciones y 0 borrados
  1. 1 0
      std/neko/NekoString__.hx

+ 1 - 0
std/neko/NekoString__.hx

@@ -115,6 +115,7 @@ class NekoString__ implements String {
 			len = sl - pos;
 		}
 
+		if( pos < 0 || len <= 0 ) return "";
 		return untyped new String(__dollar__ssub(this.__s,pos,len));
 	}