From 69786b846ff2e0afc8bbf5b699b7ead925d90129 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Thu, 25 Apr 2024 16:21:44 -0400 Subject: xexamine: don't accept -s 0. --- xexamine.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/xexamine.c b/xexamine.c index 6a04237..94374b3 100644 --- a/xexamine.c +++ b/xexamine.c @@ -318,6 +318,10 @@ int main(int argc, char **argv) { case 's': if( (only_segment = get_address(SELF, optarg)) < 0 ) exit(1); + if(!only_segment) { + fprintf(stderr, SELF ": 0 is not a valid segment number (they start with 1).\n"); + exit(1); + } break; case 'v': xex_verbose = 1; -- cgit v1.2.3