cleanup digit_count()

This commit is contained in:
Sascha Kruse 2013-02-16 03:59:52 +01:00
parent 023473ac25
commit c4947fc0cd

11
utils.c
View File

@ -62,15 +62,8 @@ char *string_append(char *a, const char *b, const char *sep)
int digit_count(int i) int digit_count(int i)
{ {
int len = 0; i = ABS(i);
if (i == 0) { int len = 1;
return 1;
}
if (i < 0) {
len++;
i *= -1;
}
while (i > 0) { while (i > 0) {
len++; len++;