[bugfix] ungetc enters infinite loop
This commit is contained in:
parent
44be26b36f
commit
1b45536fe2
|
@ -177,7 +177,7 @@ pic_fread(void *ptr, size_t block, size_t nitems, pic_file *file)
|
|||
/* take care of ungetc buf */
|
||||
while (file->ur > 0) {
|
||||
*dst++ = file->ub[--file->ur];
|
||||
if (size == 0)
|
||||
if (--size == 0)
|
||||
return block * nitems;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue