cmake/Tests/RunCMake/print_stdin.c

19 lines
314 B
C
Raw Normal View History

2018-11-29 20:27:00 +01:00
#include <stdio.h>
2024-04-14 22:45:38 +02:00
int main(void)
2018-11-29 20:27:00 +01:00
{
char buf[1024];
size_t nIn = sizeof(buf);
while (nIn == sizeof(buf)) {
nIn = fread(buf, 1, sizeof(buf), stdin);
if (nIn > 0) {
size_t nOut;
nOut = fwrite(buf, 1, nIn, stdout);
if (nOut != nIn) {
return 1;
}
}
}
return 0;
}