From d9295c2dc30fdbadf6ab2bdeea93494bec3ea1a1 Mon Sep 17 00:00:00 2001 From: Marc Feeley Date: Fri, 17 Apr 2015 14:51:29 -0400 Subject: [PATCH] Fix C++ type error with ___write_console_fallback --- include/stamp.h | 2 +- lib/os_base.c | 8 +++++--- lib/os_base.h | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/include/stamp.h b/include/stamp.h index 9bccfbcb7..e0b20b760 100644 --- a/include/stamp.h +++ b/include/stamp.h @@ -3,4 +3,4 @@ */ #define ___STAMP_YMD 20150417 -#define ___STAMP_HMS 182424 +#define ___STAMP_HMS 185128 diff --git a/lib/os_base.c b/lib/os_base.c index f17dbdaf8..6074693d4 100644 --- a/lib/os_base.c +++ b/lib/os_base.c @@ -742,11 +742,11 @@ char **msgs;) ___SIZE_T ___write_console_fallback - ___P((char *buf, + ___P((void *buf, ___SIZE_T size), (buf, size) -char *buf; +void *buf; ___SIZE_T size;) { #ifdef USE_syslog @@ -754,11 +754,13 @@ ___SIZE_T size;) static char line_buf[128]; static int line_len = 0; int i = 0; + char *b = ___CAST(char*,buf); + while (i < size) { char c; if (line_len == sizeof(line_buf)-1 || - (c = buf[i++]) == '\n') + (c = b[i++]) == '\n') { line_buf[line_len] = '\0'; syslog (LOG_ERR, "%s", line_buf); diff --git a/lib/os_base.h b/lib/os_base.h index 297797556..4b0d4a98e 100644 --- a/lib/os_base.h +++ b/lib/os_base.h @@ -222,7 +222,7 @@ extern void ___display_error */ extern ___SIZE_T ___write_console_fallback - ___P((char *buf, + ___P((void *buf, ___SIZE_T size), ());