Skip to content

Commit 750467c

Browse files
committed
Allow 3 or 4 extra params before hard fail
1 parent ca3110c commit 750467c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tools/keytools/sign.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2774,19 +2774,21 @@ static int process_args(int argc, char** argv) {
27742774
#ifdef DEBUG_SIGNTOOL
27752775
printf(" (#%d is not a setting, abort processing of remaining %d args as settings)\n", i, argc - i);
27762776
#endif
2777-
if (i == (argc - 3)) {
2777+
if ((i == (argc - 3)) || (i == (argc - 4)))
2778+
{
27782779
/* Looks like we have good parameters */
27792780
#ifdef DEBUG_SIGNTOOL
27802781
printf("Detected positional arguments.\n");
27812782
printf("Using:\n");
27822783
printf(" Image: %s\n", argv[i + 0]);
27832784
printf(" Key: %s\n", argv[i + 1]);
27842785
printf(" Version: %s\n", argv[i + 2]);
2786+
printf(" Output: %s\n", argv[i + 3]);
27852787
#endif
27862788
}
27872789
else {
2788-
printf("Error: expected exactly 3 positional arguments after options, got %d.\n", argc);
2789-
printf("Usage: %s [OPTIONS] IMAGE.BIN KEY.DER VERSION\n", argv[0]);
2790+
printf("Error: expected exactly 3 or 4 positional arguments after options, got %d.\n", argc - i);
2791+
printf("Usage: %s [OPTIONS] IMAGE.BIN KEY.DER VERSION [output]\n", argv[0]);
27902792

27912793
exit(1);
27922794
}

0 commit comments

Comments
 (0)