Fix more argc checks
Signed-off-by: Aditya Deshpande <aditya.deshpande@arm.com>
This commit is contained in:
parent
3b18a29c13
commit
9b45f6bb68
2 changed files with 2 additions and 2 deletions
|
@ -169,7 +169,7 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
mbedtls_md_init(&md_ctx);
|
mbedtls_md_init(&md_ctx);
|
||||||
|
|
||||||
if (argc == 1) {
|
if (argc < 2) {
|
||||||
const int *list;
|
const int *list;
|
||||||
|
|
||||||
mbedtls_printf("print mode: generic_sum <mbedtls_md> <file> <file> ...\n");
|
mbedtls_printf("print mode: generic_sum <mbedtls_md> <file> <file> ...\n");
|
||||||
|
|
|
@ -40,7 +40,7 @@ int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (argc == 1 || strcmp(argv[1], "-h") == 0) {
|
if (argc < 2 || strcmp(argv[1], "-h") == 0) {
|
||||||
mbedtls_printf(USAGE, argv[0]);
|
mbedtls_printf(USAGE, argv[0]);
|
||||||
return MBEDTLS_EXIT_FAILURE;
|
return MBEDTLS_EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue