From 6f20fa7916b73f30337a6b411d64e4b6fd65d5cc Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 26 Oct 2014 10:17:14 +0000 Subject: Again #538. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7422 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/various/chprintf.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'os/various/chprintf.h') diff --git a/os/various/chprintf.h b/os/various/chprintf.h index c9bd3d91f..5d624a5f1 100644 --- a/os/various/chprintf.h +++ b/os/various/chprintf.h @@ -37,7 +37,7 @@ #ifdef __cplusplus extern "C" { #endif - void chvprintf(BaseSequentialStream *chp, const char *fmt, va_list ap); + int chvprintf(BaseSequentialStream *chp, const char *fmt, va_list ap); int chsnprintf(char *str, size_t size, const char *fmt, ...); #ifdef __cplusplus } @@ -66,12 +66,15 @@ extern "C" { * * @api */ -static inline void chprintf(BaseSequentialStream *chp, const char *fmt, ...) { +static inline int chprintf(BaseSequentialStream *chp, const char *fmt, ...) { va_list ap; + int formatted_bytes; va_start(ap, fmt); - chvprintf(chp, fmt, ap); + formatted_bytes = chvprintf(chp, fmt, ap); va_end(ap); + + return formatted_bytes; } #endif /* _CHPRINTF_H_ */ -- cgit v1.2.3