aboutsummaryrefslogtreecommitdiff
path: root/coreutils/printf.c
diff options
context:
space:
mode:
Diffstat (limited to 'coreutils/printf.c')
-rw-r--r--coreutils/printf.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/coreutils/printf.c b/coreutils/printf.c
index 2cc238439..c8395fa89 100644
--- a/coreutils/printf.c
+++ b/coreutils/printf.c
@@ -122,16 +122,14 @@ static double my_xstrtod(const char *arg)
122 return result; 122 return result;
123} 123}
124 124
125static void print_esc_string(char *str) 125static void print_esc_string(const char *str)
126{ 126{
127 while (*str) { 127 char c;
128 if (*str == '\\') { 128 while ((c = *str) != '\0') {
129 str++; 129 str++;
130 bb_putchar(bb_process_escape_sequence((const char **)&str)); 130 if (c == '\\')
131 } else { 131 c = bb_process_escape_sequence(&str);
132 bb_putchar(*str); 132 putchar(c);
133 str++;
134 }
135 } 133 }
136} 134}
137 135
@@ -344,7 +342,7 @@ static char **print_formatted(char *f, char **argv, int *conv_err)
344 f--; 342 f--;
345 break; 343 break;
346 default: 344 default:
347 bb_putchar(*f); 345 putchar(*f);
348 } 346 }
349 } 347 }
350 348