diff --git a/src/ff.c b/src/ff.c index 4892867..071fc63 100644 --- a/src/ff.c +++ b/src/ff.c @@ -183,8 +183,7 @@ void scan() { case 0x70797466: // "ftyp" switch (*(b + 1)) { case 0x6D6F7369: // "isom" - //TODO: WARNING -- m4a is based on this - report("ISO Base Media (MPEG-4) v1 video"); + report("ISO Base Media (MPEG-4) v1 video container"); return; case 0x20207471: // "qt " report("QuickTime video"); diff --git a/src/images/flif.c b/src/images/flif.c index 591182b..4333ec6 100644 --- a/src/images/flif.c +++ b/src/images/flif.c @@ -23,7 +23,7 @@ void scan_flif() { case 1: printl(", Grayscale"); break; case 3: printl(", RGB"); break; case 4: printl(", RGBA"); break; - default: printl(", %d channels", h.type & 0xF); + default: printf(", %d channels", h.type & 0xF); } switch (h.type >> 4) { diff --git a/src/images/gif.c b/src/images/gif.c index 85f13d7..8a28267 100644 --- a/src/images/gif.c +++ b/src/images/gif.c @@ -24,15 +24,15 @@ void scan_gif() { if (h.packed & GLOBAL_COLOR_TABLE) { printl(", Global Color Table"); if (h.packed & 3) - printl(" of %lf bytes", pow(2, ((h.packed & 3) + 1))); + printf(" of %lf bytes", pow(2, ((h.packed & 3) + 1))); if (h.packed & SORT_FLAG) printl(", Sorted"); if (h.bgcolor) - printl(", BG Index of %X", h.bgcolor); + printf(", BG Index of %X", h.bgcolor); } if (h.aspect) - printl(", %f pixel ratio (reported)", ((float)h.aspect + 15) / 64); + printf(", %f pixel ratio (reported)", ((float)h.aspect + 15) / 64); } putchar('\n'); diff --git a/src/main.c b/src/main.c index 113805e..96ab4c7 100644 --- a/src/main.c +++ b/src/main.c @@ -14,7 +14,7 @@ void help() { puts( "Simple binary file scanner\n" - " Usage: ff [OPTIONS] FILE\n" + " Usage: ff FILE [OPTIONS]\n" " ff {-v|--version|-h|--help}\n" "\nOPTIONS\n" " -c Continue on soft symbolic link\n" @@ -94,15 +94,15 @@ MAIN { return 0; } while (--argc >= 1) { - ++argv; if (_args) { - if ((*argv)[1] == '-') { // long arguments - sb(*argv + 2); continue; - } else if ((*argv)[0] == '-') { // short arguments - sa(*argv); continue; + if (argv[argc][1] == '-') { // long arguments + sb(argv[argc] + 2); continue; + } else if (argv[argc][0] == '-') { // short arguments + sa(argv[argc]); continue; } } - _currf = *argv; + _currf = argv[argc]; + // -- Windows -- #ifdef _WIN32 uint32_t a = GetFileAttributesW(_currf); if (a == 0xFFFFFFFF) { // INVALID_FILE_ATTRIBUTES @@ -135,7 +135,7 @@ _fo: f = CreateFileW(_currf, scan(); CloseHandle(f); } -#else // POSIX +#else // -- POSIX -- struct stat s; if (lstat(_currf, &s) == 0) { switch (s.st_mode & S_IFMT) { // stat(2)