summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorokan <okan@openbsd.org>2011-03-15 08:39:54 +0000
committerokan <okan@openbsd.org>2011-03-15 08:39:54 +0000
commit872e895f6067ef0eb2e68b38ec031ca1bda19f48 (patch)
tree7e97255dcd7b84cfa88d4755533cdee02a1c2212
parentuse appropriate timerclear macro - from Christiano F. Haesbaert (diff)
downloadwireguard-openbsd-872e895f6067ef0eb2e68b38ec031ca1bda19f48.tar.xz
wireguard-openbsd-872e895f6067ef0eb2e68b38ec031ca1bda19f48.zip
fix uninitialized variable warnings (lifted from mksh).
noticed by and ok kevlo@
-rw-r--r--bin/ksh/eval.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/bin/ksh/eval.c b/bin/ksh/eval.c
index 1918751c677..257bd02e519 100644
--- a/bin/ksh/eval.c
+++ b/bin/ksh/eval.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: eval.c,v 1.35 2010/03/24 08:27:26 fgsch Exp $ */
+/* $OpenBSD: eval.c,v 1.36 2011/03/15 08:39:54 okan Exp $ */
/*
* Expansion - quoting, separation, substitution, globbing
@@ -152,7 +152,10 @@ expand(char *cp, /* input word */
char *dp, *sp; /* dest., source */
int fdo, word; /* second pass flags; have word */
int doblank; /* field splitting of parameter/command subst */
- Expand x; /* expansion variables */
+ Expand x = {
+ /* expansion variables */
+ NULL, { NULL }, NULL, 0
+ };
SubType st_head, *st;
int newlines = 0; /* For trailing newlines in COMSUB */
int saw_eq, tilde_ok;
@@ -265,7 +268,7 @@ expand(char *cp, /* input word */
{
char *varname = ++sp; /* skip the { or x (}) */
int stype;
- int slen;
+ int slen = 0;
sp = strchr(sp, '\0') + 1; /* skip variable */
type = varsub(&x, varname, sp, &stype, &slen);