[bugfix] ungetc enters infinite loop

This commit is contained in:
Yuichi Nishiwaki 2014-01-16 19:54:19 +09:00
parent 44be26b36f
commit 1b45536fe2
1 changed files with 1 additions and 1 deletions

View File

@ -177,7 +177,7 @@ pic_fread(void *ptr, size_t block, size_t nitems, pic_file *file)
/* take care of ungetc buf */ /* take care of ungetc buf */
while (file->ur > 0) { while (file->ur > 0) {
*dst++ = file->ub[--file->ur]; *dst++ = file->ub[--file->ur];
if (size == 0) if (--size == 0)
return block * nitems; return block * nitems;
} }