Files
libretiny/cores/common/base/wraps/puts.c
2023-03-04 11:05:28 +01:00

22 lines
330 B
C

// https://github.com/embeddedartistry/libc/blob/master/src/stdio/puts.c
#include <printf/printf.h>
#include <stdio.h>
int __wrap_puts(const char *str) {
int r = 0;
for (const char *c = str; *c != 0; c++) {
putchar_((int)*c);
r++;
}
// puts adds a newline
if (r) {
putchar_('\n');
r++;
}
return r ? r : EOF;
}