]> git.sur5r.net Git - cc65/blob - libsrc/common/puts.c
Replace strdup by an assembler implementation
[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 <fcntl.h>
12 #include "_file.h"
13
14
15
16 int puts (const char* s)
17 {
18     static char nl = '\n';
19
20     /* Assume stdout is always open */
21     if (write (stdout->f_fd, s, strlen (s)) < 0 ||
22         write (stdout->f_fd, &nl, 1)        < 0) {
23         stdout->f_flags |= _FERROR;
24         return -1;
25     }
26
27     /* Done */
28     return 0;
29 }
30
31
32