diff --git a/jsonpull.c b/jsonpull.c index 47a1864e..e44cf2b2 100644 --- a/jsonpull.c +++ b/jsonpull.c @@ -116,11 +116,10 @@ again: c = getc(f); if (c == EOF) { if (current != NULL) { - // Close out open containers - return current->parent; - } else { - return NULL; + *error = "Reached EOF without all containers being closed"; } + + return NULL; } } while (c == ' ' || c == '\t' || c == '\r' || c == '\n');