forked from KolibriOS/kolibrios
libc testsuite + fixes
git-svn-id: svn://kolibrios.org@6433 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
27
programs/develop/ktcc/trunk/libc/stdio/fputs.c
Normal file
27
programs/develop/ktcc/trunk/libc/stdio/fputs.c
Normal file
@@ -0,0 +1,27 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int fputs ( const char * str, FILE * file )
|
||||
{
|
||||
int rc;
|
||||
|
||||
if(!file || !str)
|
||||
{
|
||||
errno = E_INVALIDPTR;
|
||||
return EOF;
|
||||
}
|
||||
|
||||
if ((file->mode & 3)==FILE_OPEN_READ)
|
||||
{
|
||||
errno = E_ACCESS;
|
||||
return EOF;
|
||||
}
|
||||
|
||||
while(*str)
|
||||
{
|
||||
rc = fputc(*str, file);
|
||||
if (rc < 0) return rc;
|
||||
str++;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user