소스 검색

fix demo out of bounds error

Laytan 1 년 전
부모
커밋
043dd98e91
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      examples/demo/demo.odin

+ 1 - 1
examples/demo/demo.odin

@@ -48,7 +48,7 @@ the_basics :: proc() {
 		// os.args holds the path to the current executable and any arguments passed to it.
 		if len(os.args) == 1 {
 			fmt.printf("Hellope from %v.\n", os.args[0])
-		} else {
+		} else if len(os.args) > 2 {
 			fmt.printf("%v, %v! from %v.\n", os.args[1], os.args[2], os.args[0])
 		}