Merge pull request #967 from hilbert149/exit_with_error

Fix json_parse:exit with error when input file cannot be opened
This commit is contained in:
Eric Hawicz
2026-09-07 07:56:02 -05:00
committed by GitHub
+5
View File
@@ -217,6 +217,11 @@ int main(int argc, char **argv)
{
fname = argv[optind];
fd = open(fname, O_RDONLY, 0);
if (fd < 0)
{
fprintf(stderr, "error opening %s: %s\n", fname, strerror(errno));
exit(EXIT_FAILURE);
}
}
showmem();
if (parseit(fd, showobj) != 0)