blob: a0efdbd271419448103943f00400eb74d25bfc2a (
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
#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;
}
|