From 8ce66856f9e946a08593002672aa017a6e883e54 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Mon, 16 Dec 2024 16:39:21 -0500 Subject: do not allow negative -l limit. --- uxd.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'uxd.c') diff --git a/uxd.c b/uxd.c index 95a91bd..6ea3897 100644 --- a/uxd.c +++ b/uxd.c @@ -230,7 +230,12 @@ void parse_args(int argc, char **argv) { case 'b': bold = 1; break; case 'l': - limit = parse_number(opt, optarg); break; + limit = parse_number(opt, optarg); + if(limit < 0) { + fprintf(stderr, "%s: negative limit for -l not allowed.\n", self); + exit(1); + } + break; case 'r': hilite_multi = 1; break; case 'm': -- cgit v1.2.3