summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/io/qprocess/testProcessEOF/main.cpp
blob: c997fbe5c2e867d22857f574de335ab56d3abbab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// 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>
#include <string.h>

int main()
{
    char buf[32];
    memset(buf, 0, sizeof(buf));

    char *cptr = buf;
    int c;
    while (cptr != buf + 31 && (c = fgetc(stdin)) != EOF)
        *cptr++ = (char) c;

    printf("%s", buf);
    return 0;
}