]> granicus.if.org Git - json-c/commitdiff
Merge branch 'master' of https://github.com/json-c/json-c
authorEric Hawicz <erh+git@nimenees.com>
Sat, 9 May 2020 02:25:15 +0000 (22:25 -0400)
committerEric Hawicz <erh+git@nimenees.com>
Sat, 9 May 2020 02:25:15 +0000 (22:25 -0400)
1  2 
apps/json_parse.c

index a48017bd12c7dc95ec62a78512aa528d06b91d5e,59bf10abcfd0b087304d5381c6dcb45d85483940..bba462218396808bc44454f213b44c36aee7705a
@@@ -167,17 -167,15 +167,16 @@@ int main(int argc, char **argv
                case 'f': formatted_output = 1; break;
                case 'n': show_output = 0; break;
                case 's': strict_mode = 1; break;
 -              default: /* '?' */ usage(argv[0], EXIT_FAILURE, NULL);
 +              case 'h': usage(argv[0], 0, NULL);
-               default: /* '?' */ usage(argv[0], 1, "Unknown arguments");
++              default: /* '?' */ usage(argv[0], EXIT_FAILURE, "Unknown arguments");
                }
        }
        if (optind >= argc)
        {
-               fprintf(stderr, "Expected argument after options\n");
-               exit(EXIT_FAILURE);
+               usage(argv[0], EXIT_FAILURE, "Expected argument after options");
        }
        fname = argv[optind];
        int fd = open(argv[optind], O_RDONLY, 0);
        showmem();
        if (parseit(fd, showobj) != 0)