/*
- * Copyright 1998-2016 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1998-2018 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
*/
#include "apps.h"
+#include "progs.h"
#include <ctype.h>
#include <stdio.h>
}
argc = opt_num_rest();
argv = opt_rest();
-
- if (argc != 1 || !opt_int(argv[0], &num) || num < 0)
+ if (argc == 1) {
+ if (!opt_int(argv[0], &num) || num <= 0)
+ goto end;
+ } else if (argc > 0) {
+ BIO_printf(bio_err, "Extra arguments given.\n");
goto opthelp;
+ }
out = bio_open_default(outfile, 'w', format);
if (out == NULL)
chunk = num;
if (chunk > (int)sizeof(buf))
- chunk = sizeof buf;
+ chunk = sizeof(buf);
r = RAND_bytes(buf, chunk);
if (r <= 0)
goto end;
ERR_print_errors(bio_err);
release_engine(e);
BIO_free_all(out);
- return (ret);
+ return ret;
}