summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/main.c b/main.c
index 7a9f526..487809e 100644
--- a/main.c
+++ b/main.c
@@ -74,19 +74,11 @@ long fgetsize(char* path) {
}
int parse_args(int argc, char* argv[], struct config* c) {
- // Initialize config struct
- c->pid = -1;
- c->dead = 0;
- c->truncate_dead = 0;
- c->live = 0;
- c->sockets = 0;
- c->pipes = 0;
- c->inodes = 0;
- c->showstats = 1;
- c->showsizefd = 0;
- c->showsizedead = 0;
- c->showsizelive = 0;
int i = 1;
+ // Initialize config struct to all 0
+ memset(c, 0, sizeof(struct config));
+ c->pid = -1; // Default to an impossible pid
+ c->showstats = 1; // Default to showing stats
while(i < argc) {
if(strcmp(argv[i], "-d") == 0 || strcmp(argv[i], "--dead") == 0) {

Generated by cgit