diff options
author | Richard Levitte <levitte@openssl.org> | 2018-04-20 12:27:14 +0200 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2018-04-25 11:44:26 +0200 |
commit | c36e9093914aab4bfc42af1db35558a9272607b5 (patch) | |
tree | fed8b50fe8c4a46991fbf8a66ea4052320fd98f9 /apps | |
parent | 96de2e590bad00575baa7c2c6be5767b43aa017c (diff) |
Better check of return values from app_isdir and app_access
[extended tests]
Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/6033)
Diffstat (limited to 'apps')
-rw-r--r-- | apps/opt.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/opt.c b/apps/opt.c index a9d163a480..4d06983241 100644 --- a/apps/opt.c +++ b/apps/opt.c @@ -676,13 +676,13 @@ int opt_next(void) /* Just a string. */ break; case '/': - if (app_isdir(arg) >= 0) + if (app_isdir(arg) > 0) break; BIO_printf(bio_err, "%s: Not a directory: %s\n", prog, arg); return -1; case '<': /* Input file. */ - if (strcmp(arg, "-") == 0 || app_access(arg, R_OK) >= 0) + if (strcmp(arg, "-") == 0 || app_access(arg, R_OK) == 0) break; BIO_printf(bio_err, "%s: Cannot open input file %s, %s\n", @@ -690,7 +690,7 @@ int opt_next(void) return -1; case '>': /* Output file. */ - if (strcmp(arg, "-") == 0 || app_access(arg, W_OK) >= 0 || errno == ENOENT) + if (strcmp(arg, "-") == 0 || app_access(arg, W_OK) == 0 || errno == ENOENT) break; BIO_printf(bio_err, "%s: Cannot open output file %s, %s\n", |