]>
Commit | Line | Data |
---|---|---|
1 | #include <stdio.h> | |
2 | #include <stdlib.h> | |
3 | ||
4 | #define FGETS_BUFSIZE 64 | |
5 | ||
6 | /* Problem with FreeBSD 10.3 fgets() with stdin. */ | |
7 | static void | |
8 | pl_freebsd_fgets() | |
9 | { | |
10 | char buf[FGETS_BUFSIZE]; | |
11 | ||
12 | if (fgets(buf, FGETS_BUFSIZE, stdin) == NULL) | |
13 | exit(1); | |
14 | } | |
15 | ||
16 | int | |
17 | main() | |
18 | { | |
19 | ||
20 | /* Test potential memory leaks. */ | |
21 | pl_freebsd_fgets(); | |
22 | ||
23 | /* Success! */ | |
24 | exit(0); | |
25 | } |