diff --git a/22-malloc/libc/string.c b/22-malloc/libc/string.c index 9b8a6d3..d4c99be 100644 --- a/22-malloc/libc/string.c +++ b/22-malloc/libc/string.c @@ -29,7 +29,7 @@ void hex_to_ascii(int n, char str[]) { tmp = (n >> i) & 0xF; if (tmp == 0 && zeros == 0) continue; zeros = 1; - if (tmp > 0xA) append(str, tmp - 0xA + 'a'); + if (tmp >= 0xA) append(str, tmp - 0xA + 'a'); else append(str, tmp + '0'); } diff --git a/23-fixes/libc/string.c b/23-fixes/libc/string.c index 688f4a5..4c78284 100644 --- a/23-fixes/libc/string.c +++ b/23-fixes/libc/string.c @@ -29,7 +29,7 @@ void hex_to_ascii(int n, char str[]) { tmp = (n >> i) & 0xF; if (tmp == 0 && zeros == 0) continue; zeros = 1; - if (tmp > 0xA) append(str, tmp - 0xA + 'a'); + if (tmp >= 0xA) append(str, tmp - 0xA + 'a'); else append(str, tmp + '0'); }