Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cctools/ar/ar.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,12 @@ main(argc, argv)
run_ranlib = 1;

if (argc < 3) {
if(strcmp(argv[1], "--version") == 0){
if(argc >= 2 && strcmp(argv[1], "--version") == 0){
/* Implement a gnu-style --version to be friendly to GCC. */
fprintf(stdout, "xtools-%s ar %s\nBased on Apple Inc. %s\n",
xtools_version, package_version, apple_version);
exit(0);
} else if(strcmp(argv[1], "--help") == 0){
} else if(argc >= 2 && strcmp(argv[1], "--help") == 0){
usage(0);
fprintf(stdout, "Please report bugs to %s\n", support_url);
exit(0);
Expand Down