From 8eebe18922dfce42dc3200201871b16e405330a0 Mon Sep 17 00:00:00 2001 From: Jonas 'Sortie' Termansen Date: Sun, 8 Jan 2012 01:57:45 +0100 Subject: [PATCH] Added an implementation of puts(3) because gcc needs it. I still didn't add it to stdio.h since it's still stupid. --- libmaxsi/c/stdio.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libmaxsi/c/stdio.c b/libmaxsi/c/stdio.c index d76467a6..d3beb827 100644 --- a/libmaxsi/c/stdio.c +++ b/libmaxsi/c/stdio.c @@ -47,3 +47,12 @@ int putchar(int c) { return fputc(c, stdout); } + +/* This function is quite stupid because of its trailing newline that fputs(3) + does not have - but it's still better than gets(3). I'd have left it out if + various programs didn't need it. */ +int puts(const char* str) +{ + return printf("%s\n", str) < 0 ? EOF : 1; +} +