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; }