[bugfix] call setvbuf in pic_file constructor
This commit is contained in:
parent
3d72464e80
commit
14b73501c4
|
@ -82,12 +82,19 @@ pic_funopen(void *cookie,
|
|||
if (! file) {
|
||||
return NULL;
|
||||
}
|
||||
/* no buffering at the beginning */
|
||||
file->buf = NULL;
|
||||
file->mode = _IONBF;
|
||||
file->bufsiz = 0;
|
||||
/* set vtable */
|
||||
file->vtable.cookie = cookie;
|
||||
file->vtable.read = read;
|
||||
file->vtable.write = write;
|
||||
file->vtable.seek = seek;
|
||||
file->vtable.close = close;
|
||||
|
||||
pic_setvbuf(file, (char *)NULL, _IOFBF, 0);
|
||||
|
||||
return file;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue