소스 검색

Fix substr on empty string

Pascal Peridont 19 년 전
부모
커밋
3e38ac361e
1개의 변경된 파일1개의 추가작업 그리고 0개의 파일을 삭제
  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));
 	}