fopencookie.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:10:52 +01:00
parent f518495150
commit d41abf5dc6
1 changed files with 6 additions and 6 deletions

View File

@ -378,7 +378,7 @@ main(int argc, char *argv[])
.seek = memfile_seek,
.close = memfile_close
};
FILE *fp;
FILE *stream;
struct memfile_cookie mycookie;
ssize_t nread;
long p;
@ -397,8 +397,8 @@ main(int argc, char *argv[])
mycookie.offset = 0;
mycookie.endpos = 0;
fp = fopencookie(&mycookie,"w+", memfile_func);
if (fp == NULL) {
stream = fopencookie(&mycookie,"w+", memfile_func);
if (stream == NULL) {
perror("fopencookie");
exit(EXIT_FAILURE);
}
@ -406,7 +406,7 @@ main(int argc, char *argv[])
/* Write command\-line arguments to our file */
for (j = 1; j < argc; j++)
if (fputs(argv[j], fp) == EOF) {
if (fputs(argv[j], stream) == EOF) {
perror("fputs");
exit(EXIT_FAILURE);
}
@ -414,11 +414,11 @@ main(int argc, char *argv[])
/* Read two bytes out of every five, until EOF */
for (p = 0; ; p += 5) {
if (fseek(fp, p, SEEK_SET) == \-1) {
if (fseek(stream, p, SEEK_SET) == \-1) {
perror("fseek");
exit(EXIT_FAILURE);
}
nread = fread(buf, 1, 2, fp);
nread = fread(buf, 1, 2, stream);
if (nread == \-1) {
perror("fread");
exit(EXIT_FAILURE);