summaryrefslogtreecommitdiffstats
path: root/third_party/rust/lucet-wasi-wasmsbx/examples/pseudoquine.c
blob: 9111caf25d958abe54a9962d1b4892187d5f5143 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <stdio.h>
#include <stdlib.h>

int main()
{
    FILE *self = fopen("/examples/pseudoquine.c", "r");
    if (self == NULL) {
        return 1;
    }

    char c = fgetc(self);
    while (c != EOF) {
        if (fputc(c, stdout) == EOF) {
            return 1;
        }
        c = fgetc(self);
    }
}