diff options
author | David Timber <david@lyset.snart.me> | 2019-12-29 01:48:14 +1100 |
---|---|---|
committer | David Timber <david@lyset.snart.me> | 2019-12-29 01:48:14 +1100 |
commit | f765952dc8b77ad36e4f624086441d290e82bf66 (patch) | |
tree | dbfffe1090bedca16a64d5fc07e45ba0aef2e3aa /src/proone-packer.c | |
parent | 5f341e4c20767f08165776bdf559b096dc8996e9 (diff) |
checkpoint
Diffstat (limited to 'src/proone-packer.c')
-rw-r--r-- | src/proone-packer.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/proone-packer.c b/src/proone-packer.c index 3568bf8..28fd525 100644 --- a/src/proone-packer.c +++ b/src/proone-packer.c @@ -14,7 +14,7 @@ #include "proone_protocol.h" -int main (const int args, const char **argc) { +int main (const int argc, const char **args) { typedef struct { proone_arch_t arch; const char *path; @@ -31,8 +31,8 @@ int main (const int args, const char **argc) { struct stat st; uint8_t head[4]; - if (args <= 1) { - fprintf(stderr, "Usage: %s <path to binary 1> [path to binary 2 [path to binary ...]]\n", argc[0]); + if (argc <= 1) { + fprintf(stderr, "Usage: %s <path to binary 1> [path to binary 2 [path to binary ...]]\n", args[0]); return 1; } // refuse to run if stdout is terminal @@ -41,8 +41,8 @@ int main (const int args, const char **argc) { return 1; } // too many files - if (args - 1 > NB_PROONE_ARCH) { - fprintf(stderr, "** Too many files given (%d > %d).\n", args - 1, NB_PROONE_ARCH); + if (argc - 1 > NB_PROONE_ARCH) { + fprintf(stderr, "** Too many files given (%d > %d).\n", argc - 1, NB_PROONE_ARCH); return 1; } @@ -51,8 +51,8 @@ int main (const int args, const char **argc) { memset(archive_arr, 0, sizeof(archive_tuple_t) * NB_PROONE_ARCH); // Check the file names are valid - for (i = 1; i < (size_t)args; i += 1) { - path = argc[i]; + for (i = 1; i < (size_t)argc; i += 1) { + path = args[i]; ext = strrchr(path, '.'); if (ext == NULL) { |