diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2005-12-27 05:04:28 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2005-12-27 05:04:28 +0000 |
commit | 8e7d5d935f21c63c4841bbfb36742bd362e829c0 (patch) | |
tree | 8606a8ca878b41650b764727a49b60e614601e7e /usr.bin/sdiff | |
parent | 70c218c0661ba27a4c4430956be019415528ecc8 (diff) |
shorten main initialization
Diffstat (limited to 'usr.bin/sdiff')
-rw-r--r-- | usr.bin/sdiff/sdiff.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/usr.bin/sdiff/sdiff.c b/usr.bin/sdiff/sdiff.c index 250f7e6892b..7f122a455e6 100644 --- a/usr.bin/sdiff/sdiff.c +++ b/usr.bin/sdiff/sdiff.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sdiff.c,v 1.9 2005/12/27 04:46:32 tedu Exp $ */ +/* $OpenBSD: sdiff.c,v 1.10 2005/12/27 05:04:27 deraadt Exp $ */ /* * Written by Raymond Lai <ray@cyth.net>. @@ -85,16 +85,10 @@ int main(int argc, char **argv) { FILE *difffile, *origfile; - size_t argc_max, diffargc, wflag; + size_t diffargc = 0, wflag = WIDTH; int ch, fd[2], status; pid_t pid; - const char *cmd, **diffargv, *diffprog; - - /* Initialize variables. */ - diffargc = 0; - diffprog = "diff"; - outfile = NULL; - wflag = WIDTH; + const char *cmd, **diffargv, *diffprog = "diff"; /* * Process diff flags. @@ -107,8 +101,7 @@ main(int argc, char **argv) * waste some memory; however we need an extra space for the * NULL at the end, so it sort of works out. */ - argc_max = argc * 2; - if (!(diffargv = malloc(sizeof(char **) * argc_max))) + if (!(diffargv = malloc(sizeof(char **) * argc * 2))) err(2, "main"); /* Add first argument, the program name. */ |