4 read chars from input until newline is found or buffer is full
5 return if buffer overflowed while filling
10 keep printing input until newline is found
17 while status not changed
22 print rest of line until newline
29 int readbuffer(char *buffer
)
37 if (c
== EOF
) { return -1; }
38 if(c
== '\n') { return 0; }
44 int printline(char *buffer
)
48 for(i
= 0; i
< MAX
; ++i
)
54 if (c
== EOF
) { endfound
= -1; }
55 else if (c
== '\n' ) { endfound
= 0; }
69 status
= readbuffer(buffer
);
71 status
= printline(buffer
);