From b6f858f08d355739c49099f87a8590379f2b250d Mon Sep 17 00:00:00 2001
From: Christian Hesse <mail@eworm.de>
Date: Mon, 20 Jan 2025 12:03:11 +0100
Subject: [PATCH 1/1] fix breakage in unhex

This broke in commit 23491ebf40cd85de4ec62b135da513cbe88632e0, where
ITEMS_COUNT was introduced for procps_pids_new(). But we still want to
calculate with base of 16 here...

Fixes: https://gitlab.com/procps-ng/procps/-/issues/369

Signed-off-by: Christian Hesse <mail@eworm.de>
---
 src/pgrep.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/pgrep.c b/src/pgrep.c
index 6fc25dd4..4fdc46ce 100644
--- a/src/pgrep.c
+++ b/src/pgrep.c
@@ -498,7 +498,7 @@ static unsigned long long unhex (const char *restrict in)
     unsigned long long ret;
     char *rem;
     errno = 0;
-    ret = strtoull(in, &rem, ITEMS_COUNT);
+    ret = strtoull(in, &rem, 16);
     if (errno || *rem != '\0') {
         xwarnx(_("not a hex string: %s"), in);
         return 0;
