From e953b66f7814bb4330f887296c312aa2f7638163 Mon Sep 17 00:00:00 2001 From: David Kopf Date: Wed, 3 Aug 2011 11:10:26 -0400 Subject: [PATCH] avr-libc %.*s workaround --- apps/serial-shell/serial-shell.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/apps/serial-shell/serial-shell.c b/apps/serial-shell/serial-shell.c index d8ba9740b..b5a7515c3 100644 --- a/apps/serial-shell/serial-shell.c +++ b/apps/serial-shell/serial-shell.c @@ -67,7 +67,14 @@ shell_default_output(const char *text1, int len1, const char *text2, int len2) text2 = ""; len2 = 0; } - printf("%.*s%.*s\r\n", len1, text1, len2, text2); + + /* Workaround for absence of "%.*s" format in avr-libc */ +#if defined (__AVR__) + printf("%s%s\r\n", text1, text2); +#else + *printf("%.*s%.*s\r\n", len1, text1, len2, text2); +#endif + } /*---------------------------------------------------------------------------*/ void