rots-utils: initialise args to zero

master
S.J.R. van Schaik 7 years ago
parent 73b7785f9d
commit 60b1fa93a2
  1. 2
      source/pack.c
  2. 2
      source/sign.c
  3. 4
      source/unpack.c
  4. 2
      source/verify.c

@ -69,7 +69,7 @@ int do_pack(int argc, char *argv[])
{ {
char data[4096]; char data[4096];
struct rots_hdr hdr; struct rots_hdr hdr;
struct args args; struct args args = { 0 };
FILE *input, *output; FILE *input, *output;
size_t nbytes, size; size_t nbytes, size;

@ -186,7 +186,7 @@ void show_sign_usage(const char *prog_name, const char *cmd)
int do_sign(int argc, char *argv[]) int do_sign(int argc, char *argv[])
{ {
struct args args; struct args args = { 0 };
EVP_PKEY *key; EVP_PKEY *key;
X509 *cert; X509 *cert;
char *cn; char *cn;

@ -64,11 +64,9 @@ int do_unpack(int argc, char *argv[])
char data[512]; char data[512];
struct rots_hdr hdr; struct rots_hdr hdr;
FILE *in, *out; FILE *in, *out;
struct args args; struct args args = { 0 };
size_t nbytes, size; size_t nbytes, size;
memset(&args, 0, sizeof args);
if (parse_args(&args, argc, argv) < 0) { if (parse_args(&args, argc, argv) < 0) {
show_unpack_usage(argv[0], argv[1]); show_unpack_usage(argv[0], argv[1]);
return -1; return -1;

@ -240,7 +240,7 @@ void show_verify_usage(const char *prog_name, const char *cmd)
int do_verify(int argc, char *argv[]) int do_verify(int argc, char *argv[])
{ {
struct args args; struct args args = { 0 };
size_t count, total; size_t count, total;
if (parse_args(&args, argc, argv) < 0) { if (parse_args(&args, argc, argv) < 0) {

Loading…
Cancel
Save