summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/io/qprocess/testProcessEcho3/main.cpp
blob: 7f2c78e20d0200d3bb9c7179d84fcbca6dfb48db (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 WITH Qt-GPL-exception-1.0


#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;
}