mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
json: properly handle EOF in json format
This commit is contained in:
parent
2f0aebedc2
commit
30c15be7ae
1 changed files with 3 additions and 0 deletions
|
@ -333,6 +333,9 @@ int json_scan(struct io *io, struct sample *smps[], unsigned cnt)
|
|||
FILE *f = io_stream_input(io);
|
||||
|
||||
for (i = 0; i < cnt; i++) {
|
||||
if (feof(f))
|
||||
return -1;
|
||||
|
||||
skip: json = json_loadf(f, JSON_DISABLE_EOF_CHECK, &err);
|
||||
if (!json)
|
||||
break;
|
||||
|
|
Loading…
Add table
Reference in a new issue