]> git.itanic.dy.fi Git - scan-pagemap/commitdiff
main.c: Clear the options structure before using
authorTimo Kokkonen <kaapeli@itanic.dy.fi>
Fri, 23 Jul 2010 11:04:21 +0000 (14:04 +0300)
committerTimo Kokkonen <kaapeli@itanic.dy.fi>
Fri, 23 Jul 2010 11:05:12 +0000 (14:05 +0300)
Obviously it is not guaranteed that the contents of the structure are
zeroed if the content is allocated from the stack..

Signed-off-by: Timo Kokkonen <kaapeli@itanic.dy.fi>
main.c

diff --git a/main.c b/main.c
index 75db46943ec0cf4aca1ed587f5a2df13fa569167..c629938eb7922c7ace5924ff66cd0ea0db621ce7 100644 (file)
--- a/main.c
+++ b/main.c
@@ -68,6 +68,8 @@ int main(int argc, char *argv[])
        struct process *process_list = NULL;
        struct parse_opts opts;
 
+       memset(&opts, 0, sizeof(opts));
+
        read_args(argc, argv, &opts);
 
        if (argc < 3) {