ucspi-tcp6 1.13.02
ucspi-tcp6
Loading...
Searching...
No Matches
addcr.c
Go to the documentation of this file.
1#include "buffer.h"
2#include "exit.h"
3
4int main()
5{
6 register int n;
7 register char *x;
8 char ch;
9
10 for (;;) {
11 n = buffer_feed(buffer_0);
12 if (n < 0) _exit(111);
13 if (!n) _exit(0);
14 x = buffer_PEEK(buffer_0);
15 buffer_SEEK(buffer_0,n);
16 while (n > 0) {
17 ch = *x++; --n;
18 if (ch == '\n') buffer_PUTC(buffer_1,"\r"[0]);
19 buffer_PUTC(buffer_1,ch);
20 }
21 }
22}
int main()
Definition: addcr.c:4