Skip to content

Commit 0627265

Browse files
committed
quick fixes
1 parent 7bcd1cc commit 0627265

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

emojicrypt.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,12 +510,16 @@ supported by Windows' cmd.\n\n");
510510
case 'h': /* help */
511511
helpme(argv[0]);
512512
return EXIT_SUCCESS;
513-
break;
514513
default:
515514
fprintf(stderr, "Usage: %s [-e] [-d] -i input -o output -k key\n", argv[0]);
516515
return 1;
517516
}
518517
}
518+
519+
if (argc == 1) {
520+
helpme(argv[0]);
521+
return EXIT_SUCCESS;
522+
}
519523

520524
if (o_enc && o_dec) {
521525
fprintf(stderr, "🚧 Encryption (-e) and decryption (-d) flags are incompatible.\n");
@@ -527,6 +531,11 @@ supported by Windows' cmd.\n\n");
527531
return EXIT_FAILURE;
528532
}
529533

534+
if (!o_out) {
535+
fprintf(stderr, "🚧 An output file (-o) is required.\n");
536+
return EXIT_FAILURE;
537+
}
538+
530539
if (!o_enc && !o_dec) {
531540
fprintf(stderr, "🚧 Encryption (-e) or decryption (-d) flag is required.\n");
532541
return EXIT_FAILURE;

0 commit comments

Comments
 (0)