Fixed compatibility of output.
[AROS.git] / compiler / posixc / fputs.c
blob9fe18632b5d3644eac3738b45c3a7713303463d5
1 /*
2 Copyright © 1995-2012, The AROS Development Team. All rights reserved.
3 $Id$
5 C99 function fputs().
6 */
8 #include <proto/dos.h>
9 #include <errno.h>
10 #include "__fdesc.h"
11 #include "__stdio.h"
13 /*****************************************************************************
15 NAME */
16 #include <stdio.h>
18 int fputs (
20 /* SYNOPSIS */
21 const char * str,
22 FILE * stream)
24 /* FUNCTION
25 Write a string to the specified stream.
27 INPUTS
28 str - Output this string...
29 fh - ...to this stream
31 RESULT
32 > 0 on success and EOF on error.
34 NOTES
36 EXAMPLE
38 BUGS
40 SEE ALSO
41 puts(), fputc(), putc()
43 INTERNALS
45 ******************************************************************************/
47 fdesc *fdesc = __getfdesc(stream->fd);
49 if (!fdesc)
51 errno = EBADF;
52 return EOF;
55 if (!str) str = "(null)";
57 if (FPuts(fdesc->fcb->handle, str) == -1)
59 errno = __stdc_ioerr2errno(IoErr());
60 return EOF;
63 return 0;
64 } /* fputs */