introduce bb_putchar(). saves ~1800 on uclibc (less on glibc).
diff --git a/coreutils/printf.c b/coreutils/printf.c
index d0cf5a6..d5ef32e 100644
--- a/coreutils/printf.c
+++ b/coreutils/printf.c
@@ -99,9 +99,9 @@
for (; *str; str++) {
if (*str == '\\') {
str++;
- putchar(bb_process_escape_sequence((const char **)&str));
+ bb_putchar(bb_process_escape_sequence((const char **)&str));
} else {
- putchar(*str);
+ bb_putchar(*str);
}
}
@@ -205,7 +205,7 @@
direc_length = 1;
field_width = precision = -1;
if (*f == '%') {
- putchar('%');
+ bb_putchar('%');
break;
}
if (*f == 'b') {
@@ -274,11 +274,11 @@
case '\\':
if (*++f == 'c')
exit(0);
- putchar(bb_process_escape_sequence((const char **)&f));
+ bb_putchar(bb_process_escape_sequence((const char **)&f));
f--;
break;
default:
- putchar(*f);
+ bb_putchar(*f);
}
}