From 48f81212b32eafef4518810d896cc242a881dc19 Mon Sep 17 00:00:00 2001 From: Jonathan Turner Date: Wed, 29 Nov 2023 09:59:14 -0500 Subject: [PATCH] maybe pt.2? --- Part3/09_memory/kernel/kernel.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Part3/09_memory/kernel/kernel.c b/Part3/09_memory/kernel/kernel.c index 2c0a99e..2cc209d 100644 --- a/Part3/09_memory/kernel/kernel.c +++ b/Part3/09_memory/kernel/kernel.c @@ -117,15 +117,15 @@ int digit_len(unsigned digit) { - if (x >= 1000000000) return 10; - if (x >= 100000000) return 9; - if (x >= 10000000) return 8; - if (x >= 1000000) return 7; - if (x >= 100000) return 6; - if (x >= 10000) return 5; - if (x >= 1000) return 4; - if (x >= 100) return 3; - if (x >= 10) return 2; + if (digit >= 1000000000) return 10; + if (digit >= 100000000) return 9; + if (digit >= 10000000) return 8; + if (digit >= 1000000) return 7; + if (digit >= 100000) return 6; + if (digit >= 10000) return 5; + if (digit >= 1000) return 4; + if (digit >= 100) return 3; + if (digit >= 10) return 2; return 1; }