Function like macros make following the execution flow unnecessarily
difficult, and deserves to be removed.
Requested-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
*/
static void write_line(char *s)
{
- char c;
-
-#define PUTC(c) if (fputc_careful(c, stdout, '^') == EOF) \
- err(EXIT_FAILURE, _("carefulputc failed"));
while (*s) {
- c = *s++;
- if (c == '\n')
- PUTC('\r');
- PUTC(c);
+ const int c = *s++;
+
+ if ((c == '\n' && fputc_careful('\r', stdout, '^') == EOF)
+ || fputc_careful(c, stdout, '^') == EOF)
+ err(EXIT_FAILURE, _("carefulputc failed"));
}
- return;
-#undef PUTC
}
/*