]> git.sur5r.net Git - cc65/blob - libsrc/common/puts.c
Merge pull request #740 from laubzega/master
[cc65] / libsrc / common / puts.c
1 /*
2 ** puts.c
3 **
4 ** Ullrich von Bassewitz, 11.08.1998
5 */
6
7
8
9 #include <stdio.h>
10 #include <string.h>
11 #include <unistd.h>
12 #include "_file.h"
13
14
15
16 /*****************************************************************************/
17 /*                                   Code                                    */
18 /*****************************************************************************/
19
20
21
22 int __fastcall__ puts (const char* s)
23 {
24     static char nl = '\n';
25
26     /* Assume stdout is always open */
27     if (write (stdout->f_fd, s, strlen (s)) < 0 ||
28         write (stdout->f_fd, &nl, 1)        < 0) {
29         stdout->f_flags |= _FERROR;
30         return -1;
31     }
32
33     /* Done */
34     return 0;
35 }
36
37
38