14 short ibuff
[BUFSIZ
], obuff
[BUFSIZ
];
17 while ((rc
= read (0, ibuff
, sizeof (ibuff
))) > 0) {
18 memset (obuff
, 0, sizeof (obuff
));
19 for (i
= 0; i
< (rc
+ 1) / 2; i
++) {
20 obuff
[i
] = ibuff
[i
^ 1];
25 if (write (1, obuff
, len
) != len
) {
26 perror ("read error");
27 return (EXIT_FAILURE
);
30 memset (ibuff
, 0, sizeof (ibuff
));
34 perror ("read error");
35 return (EXIT_FAILURE
);
37 return (EXIT_SUCCESS
);