mirror of
git://git.musl-libc.org/musl
synced 2025-01-03 04:52:03 +00:00
minor cleanup in fopencookie
assign entire struct rather than member-at-a-time. don't repeat buffer sizes; always use sizeof to ensure consistency.
This commit is contained in:
parent
c9f415d7ea
commit
4245a233c1
@ -116,15 +116,12 @@ FILE *fopencookie(void *cookie, const char *mode, cookie_io_functions_t iofuncs)
|
||||
|
||||
/* Set up our fcookie */
|
||||
f->fc.cookie = cookie;
|
||||
f->fc.iofuncs.read = iofuncs.read;
|
||||
f->fc.iofuncs.write = iofuncs.write;
|
||||
f->fc.iofuncs.seek = iofuncs.seek;
|
||||
f->fc.iofuncs.close = iofuncs.close;
|
||||
f->fc.iofuncs = iofuncs;
|
||||
|
||||
f->f.fd = -1;
|
||||
f->f.cookie = &f->fc;
|
||||
f->f.buf = f->buf + UNGET;
|
||||
f->f.buf_size = BUFSIZ;
|
||||
f->f.buf_size = sizeof f->buf - UNGET;
|
||||
f->f.lbf = EOF;
|
||||
|
||||
/* Initialize op ptrs. No problem if some are unneeded. */
|
||||
|
Loading…
Reference in New Issue
Block a user