diff --git a/components/libc/compilers/armlibc/stubs.c b/components/libc/compilers/armlibc/stubs.c index c826c8a0ec8dc62d419b7af5ec3224f16868db3a..83306a258d444af06cfb3b56dfa7be5e28d63bfe 100644 --- a/components/libc/compilers/armlibc/stubs.c +++ b/components/libc/compilers/armlibc/stubs.c @@ -313,17 +313,18 @@ int system(const char *string) int fputc(int c, FILE *f) { - char ch = c; + char ch[2] = {0}; - rt_kprintf(&ch); + ch[1] = c; + rt_kprintf(&ch[0]); return 1; } int fgetc(FILE *f) { +#ifdef RT_USING_POSIX char ch; -#ifdef RT_USING_POSIX if (libc_stdio_read(&ch, 1) == 1) return ch; #endif