Node id sanity check master
authorSergey Matveev <stargrave@stargrave.org>
Sun, 29 Aug 2021 10:55:32 +0000 (13:55 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Sun, 29 Aug 2021 10:55:32 +0000 (13:55 +0300)
t

diff --git a/t b/t
index a1fcfc5ecf353914de6403b5f34dd897180a60c1..b4a2ca39bb8c0c792bc4145020c61c4049c20d17 100755 (executable)
--- a/t
+++ b/t
@@ -36,6 +36,7 @@ purge() {
 }
 
 get_note() {
+    [[ "$1" = [0-9]* ]] || { print invalid note id ; exit 1 }
     NOTE=($NOTES_DIR/*(.on[$(( $1 + 1 ))]))
     [[ ${#NOTE} -eq 0 ]] && { print note not found >&2 ; exit 1 }
     NOTE=${NOTE[1]}