summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/io/qprocess/testProcessEcho3/main.cpp
blob: 161f8bd547a6fcdf721cd52e1aaf318edaaa64d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only


#include <stdio.h>

int main()
{
    int c;
    for (;;) {
        c = fgetc(stdin);
        if (c == '\0')
            break;
        if (c != -1) {
            fputc(c, stdout);
            fputc(c, stderr);
            fflush(stdout);
            fflush(stderr);
        }
    }

    return 0;
}