X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=functions%2Fstdio%2Ffopen.c;fp=functions%2Fstdio%2Ffopen.c;h=96fdcc19803bb709efa65f28f61107ccb65cf57b;hb=13ee02fa27a739d9d602f801126eadcfbfeab8a8;hp=4a74e1776ddcc74973e2fb4981d555c19cbd4fa8;hpb=97e30a162595b6a709600f1f1d7d9ebf21f469d1;p=pdclib diff --git a/functions/stdio/fopen.c b/functions/stdio/fopen.c index 4a74e17..96fdcc1 100644 --- a/functions/stdio/fopen.c +++ b/functions/stdio/fopen.c @@ -80,9 +80,10 @@ struct _PDCLIB_file_t * fopen( const char * _PDCLIB_restrict filename, const cha /* Adding to list of open files */ rc->next = _PDCLIB_filelist; _PDCLIB_filelist = rc; - /* Setting buffer, and mark as internal. TODO: Check for unbuffered? */ + /* Setting buffer, and mark as internal. TODO: Check for unbuffered */ if ( ( rc->buffer = malloc( BUFSIZ ) ) == NULL ) goto fail; rc->bufsize = BUFSIZ; + rc->bufidx = 0; rc->status |= ( _PDCLIB_LIBBUFFER | _PDCLIB_VIRGINSTR ); /* TODO: Setting mbstate */ return rc;