From f3732b730a20b6a5a69d03f158f80412a0d62260 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Wed, 21 Oct 2020 08:49:07 +0300 Subject: [PATCH] term: replace assert with panic to enable build-module for it too --- vlib/term/term_nix.c.v | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vlib/term/term_nix.c.v b/vlib/term/term_nix.c.v index 75f11c7de2..4cb9bb3ce4 100644 --- a/vlib/term/term_nix.c.v +++ b/vlib/term/term_nix.c.v @@ -50,7 +50,9 @@ pub fn get_cursor_position() Coord { ch = C.getchar() b := byte(ch) i++ - assert i < 15 + if i >= 15 { + panic('C.getchar() called too many times') + } // state management: if b == `R` { break