summaryrefslogtreecommitdiff
path: root/userland/libc/stdio/fputs.c
blob: 5570693d765610ad37dabecf6ec153853171bb4a (plain)
1
2
3
4
5
6
7
8
9
10
11
#include <stdio.h>

int fputs(const char *s, FILE *stream) {
  const char *b = s;
  for (; *s; s++) {
    if (0 == fwrite(s, 1, 1, stream)) {
      return EOF;
    }
  }
  return s - b;
}