Browse Source

Make `strconv` more robust

gingerBill 3 years ago
parent
commit
1d7c9cf872
1 changed files with 3 additions and 1 deletions
  1. 3 1
      core/strconv/strconv.odin

+ 3 - 1
core/strconv/strconv.odin

@@ -882,7 +882,9 @@ unquote_string :: proc(lit: string, allocator := context.allocator) -> (res: str
 		return -1
 	}
 
-	assert(len(lit) >= 2)
+	if len(lit) < 2 {
+		return
+	}
 	if lit[0] == '`' {
 		return lit[1:len(lit)-1], false, true
 	}