a few oops...

This commit is contained in:
tTh
2023-07-08 12:43:00 +02:00
parent 0f245582d5
commit 2c1687f82b
4 changed files with 21 additions and 12 deletions

View File

@@ -68,7 +68,7 @@ printf("-- Fimg Extractor -- lib v%d -- %s %s\n", FIMG_VERSION,
puts("usage:\n\tfimgextract [options] source.fimg width,height,xpos,ypos");
puts("options:");
puts("\t-o out.fimg\tname the output file");
puts("\t-v\t\tmake be a blabla box");
puts("\t-v\t\tmake me a blabla box");
puts("\t-x\t\tenable crashy feature");
exit(0);
}
@@ -92,9 +92,11 @@ while ((opt = getopt(argc, argv, "ho:vx")) != -1) {
}
}
fprintf(stderr, "argc = %d optind = %d\n", argc, optind);
for (idx=optind; idx<argc; idx++) {
fprintf(stderr, " %5d %s\n", idx, argv[idx]);
if (verbosity) {
fprintf(stderr, "argc = %d optind = %d\n", argc, optind);
for (idx=optind; idx<argc; idx++) {
fprintf(stderr, " %5d %s\n", idx, argv[idx]);
}
}
if (argc==optind) {
@@ -102,13 +104,13 @@ if (argc==optind) {
exit(0);
}
foo = parse_rectangle(argv[argc-1], &area, 0);
foo = parse_rectangle(argv[optind+1], &area, 0);
if (4 != foo) {
fprintf(stderr, "%s: parse_rectangle --> %d\n", argv[0], foo);
exit(1);
}
foo = extractor(argv[argc-2], output_file, &area);
foo = extractor(argv[optind], output_file, &area);
if (foo) {
fprintf(stderr, "%s: extractor --> %d\n", __func__, foo);
exit(1);