getline.3: Consistency fix: use "stream" as name for "FILE *" argument

Inspired by Carlos O'Donell's recent patches.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2015-01-16 07:11:25 +01:00
parent d41abf5dc6
commit 363b9dceab
1 changed files with 5 additions and 5 deletions

View File

@ -150,22 +150,22 @@ They were standardized in POSIX.1-2008.
int
main(void)
{
FILE *fp;
FILE *stream;
char *line = NULL;
size_t len = 0;
ssize_t read;
fp = fopen("/etc/motd", "r");
if (fp == NULL)
stream = fopen("/etc/motd", "r");
if (stream == NULL)
exit(EXIT_FAILURE);
while ((read = getline(&line, &len, fp)) != \-1) {
while ((read = getline(&line, &len, stream)) != \-1) {
printf("Retrieved line of length %zu :\en", read);
printf("%s", line);
}
free(line);
fclose(fp);
fclose(stream);
exit(EXIT_SUCCESS);
}
.fi