mirror of
https://gitlab.freedesktop.org/uchardet/uchardet.git
synced 2025-12-08 01:36:41 +08:00
don't use feof
This commit is contained in:
parent
143b3fe513
commit
383bf118c9
@ -51,9 +51,11 @@ void detect(FILE * fp)
|
||||
{
|
||||
uchardet_t handle = uchardet_new();
|
||||
|
||||
while (!feof(fp))
|
||||
while (1)
|
||||
{
|
||||
size_t len = fread(buffer, 1, BUFFER_SIZE, fp);
|
||||
if (len == 0)
|
||||
break;
|
||||
int retval = uchardet_handle_data(handle, buffer, len);
|
||||
if (retval != 0)
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user