From a7089275f4e64a7d7a52a1c03ddd51a8566408e8 Mon Sep 17 00:00:00 2001 From: Timo Kokkonen Date: Tue, 27 Mar 2012 20:59:38 +0300 Subject: [PATCH] main: Only set non-zero elements in user_options structure As the number of elements may increase over time, it is better to zero out the entire strucutre and then explicity set default values only on those entries that have non-zero default. Signed-off-by: Timo Kokkonen --- main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main.c b/main.c index 79d22c2..a78d680 100644 --- a/main.c +++ b/main.c @@ -137,9 +137,12 @@ static int dump_entries(struct user_options *opts, int fd, int usage_code) int main(int argc, char *argv[]) { - struct user_options opts = { .usbdev = NULL, .output_path = NULL, .output_format = CLEAN, .trace_level = 0 }; + struct user_options opts; int fd, usage_code, ret, error; + bzero(&opts, sizeof(opts)); + opts.output_format = CLEAN; + if ( read_args(argc, argv, &opts) ) return -1; -- 2.45.0