Merge pull request #24 from Clownacy/master

Gave bin2h a return value
This commit is contained in:
Cucky 2019-01-28 14:50:38 -05:00 committed by GitHub
commit 3ead218902
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -8,6 +8,8 @@
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
int result = 0;
if (argc > 2) if (argc > 2)
{ {
char *last_forward_slash = strrchr(argv[1], '/'); char *last_forward_slash = strrchr(argv[1], '/');
@ -29,10 +31,12 @@ int main(int argc, char *argv[])
if (in_file == NULL) if (in_file == NULL)
{ {
printf("Couldn't open '%s'\n", argv[1]); printf("Couldn't open '%s'\n", argv[1]);
result = 1;
} }
else if (out_file == NULL) else if (out_file == NULL)
{ {
printf("Couldn't open '%s'\n", argv[2]); printf("Couldn't open '%s'\n", argv[2]);
result = 1;
} }
else else
{ {
@ -64,4 +68,10 @@ int main(int argc, char *argv[])
free(filename); free(filename);
} }
else
{
result = 1;
}
return result;
} }