From 5173b0c2220c767405176242b1f3ace530daf847 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Fri, 24 May 2024 20:43:44 +0200 Subject: [PATCH] command: return proper unsigned value Use better 'unsigned' value, so we don't have any 'casting' troubles. --- tools/command.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/command.c b/tools/command.c index 396c5c52f..5b1817bdc 100644 --- a/tools/command.c +++ b/tools/command.c @@ -421,12 +421,12 @@ static unsigned _find_lvm_command_enum(const char *name) return middle; } - return -1; + return LVM_COMMAND_COUNT; } const struct command_name *find_command_name(const char *name) { - int r = _find_lvm_command_enum(name); + unsigned r = _find_lvm_command_enum(name); return (r < LVM_COMMAND_COUNT) ? &command_names[r] : NULL; }