Added fputs(3).

This commit is contained in:
Jonas 'Sortie' Termansen 2012-03-05 13:32:42 +01:00
parent bc38dc5127
commit cd350620f2
1 changed files with 10 additions and 0 deletions

View File

@ -28,6 +28,7 @@
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
FILE* firstfile = NULL;
@ -215,3 +216,12 @@ int putc(int c, FILE* fp)
{
return fputc(c, fp);
}
int fputs(const char* str, FILE* fp)
{
size_t stringlen = strlen(str);
int result = fwrite(str, 1, stringlen, fp);
if ( result < stringlen ) { return EOF; }
return result;
}