summaryrefslogtreecommitdiff
path: root/util/libreboot-utils/lib/num.c
diff options
context:
space:
mode:
Diffstat (limited to 'util/libreboot-utils/lib/num.c')
-rw-r--r--util/libreboot-utils/lib/num.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/util/libreboot-utils/lib/num.c b/util/libreboot-utils/lib/num.c
index d297ab86..f53f0cee 100644
--- a/util/libreboot-utils/lib/num.c
+++ b/util/libreboot-utils/lib/num.c
@@ -41,10 +41,8 @@ hextonum(char ch_s)
if ((unsigned int)(ch - 'a') <= 5)
return ch - 'a' + 10;
- if (ch == '?' || ch == 'x') {
- rset(&rval, sizeof(rval));
- return rval & 0xf;
- }
+ if (ch == '?' || ch == 'x')
+ return rsize(16); /* <-- with rejection sampling! */
return 16;
}