source:
trunk/minix/lib/stdio/puts.c@
11
      
      | Last change on this file since 11 was 9, checked in by , 14 years ago | |
|---|---|
| File size: 396 bytes | |
| Rev | Line | |
|---|---|---|
| [9] | 1 | /* | 
| 2 | * puts.c - print a string onto the standard output stream | |
| 3 | */ | |
| 4 | /* $Header: /cvsup/minix/src/lib/stdio/puts.c,v 1.1.1.1 2005/04/21 14:56:36 beng Exp $ */ | |
| 5 | ||
| 6 | #include <stdio.h> | |
| 7 | ||
| 8 | int | |
| 9 | puts(register const char *s) | |
| 10 | { | |
| 11 | register FILE *file = stdout; | |
| 12 | register int i = 0; | |
| 13 | ||
| 14 | while (*s) { | |
| 15 | if (putc(*s++, file) == EOF) return EOF; | |
| 16 | else i++; | |
| 17 | } | |
| 18 | if (putc('\n', file) == EOF) return EOF; | |
| 19 | return i + 1; | |
| 20 | } | 
  Note:
 See   TracBrowser
 for help on using the repository browser.
    
