README.md: remove memleak line
[rofl0r-jobflow.git] / tests / stdin_printer.c
blobd6813ef94044d07e58d0068a90d060f3499af78e
1 /* like cat, but processing one line at a time. stdin only. */
2 #include <unistd.h>
3 #include <stdio.h>
4 #include <string.h>
6 int main() {
7 char buf[1024];
8 while(fgets(buf, sizeof buf, stdin)) {
9 ssize_t l = strlen(buf);
10 ssize_t n = write(1, buf, l);
11 if(n != l) {
12 perror("write");
13 return 1;
16 return 0;