diff options
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 16 |
1 files changed, 4 insertions, 12 deletions
@@ -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) { |