1
0
mirror of https://github.com/lxsang/ant-http synced 2024-07-01 12:59:47 +02:00

fix length bug

This commit is contained in:
lxsang 2019-11-24 14:30:03 +01:00
parent 903fdfa483
commit afc0b31184

View File

@ -508,10 +508,12 @@ int __f(void* client, const char* file)
LOG("Cannot read : %s\n", file);
return 0;
}
while(fgets(buf, sizeof(buf), ptr) != NULL)
memset(buf,0, sizeof(buf));
while(fgets(buf, sizeof(buf) - 1, ptr) != NULL)
{
nbytes = antd_send(client, buf, strlen(buf));
if(nbytes == -1) return 0;
memset(buf,0, sizeof(buf));
//LOG("READ : %s\n", buf);
//fgets(buf, sizeof(buf), ptr);
}