Mercurial > hg > dmlib
comparison lib64gfx.c @ 420:8d15443ce209
Fix lingering issue with data reading helper function.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sat, 03 Nov 2012 07:54:13 +0200 |
parents | 936bc27a79d6 |
children | ba6ec5ee5929 |
comparison
equal
deleted
inserted
replaced
419:936bc27a79d6 | 420:8d15443ce209 |
---|---|
706 goto error; | 706 goto error; |
707 } | 707 } |
708 | 708 |
709 dataPtr = dataBuf; | 709 dataPtr = dataBuf; |
710 dataRead = 0; | 710 dataRead = 0; |
711 | |
712 while (!feof(f) && !ferror(f)) | |
713 { | |
714 size_t read = fread(dataPtr, 1, readSize, f); | |
711 dataPtr += read; | 715 dataPtr += read; |
712 dataRead += read; | 716 dataRead += read; |
713 | |
714 while (!feof(f) && !ferror(f)) | |
715 { | |
716 size_t read = fread(dataPtr, 1, readSize, f); | |
717 | 717 |
718 if (dataRead >= dataSize) | 718 if (dataRead >= dataSize) |
719 { | 719 { |
720 readSize = BUF_SIZE_GROW; | 720 readSize = BUF_SIZE_GROW; |
721 dataSize += BUF_SIZE_GROW; | 721 dataSize += BUF_SIZE_GROW; |