diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2010-11-03 10:46:02 +1030 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2010-11-03 10:46:02 +1030 |
commit | 3fb6b6be5a395fbe293e61339e6be67118234508 (patch) | |
tree | 63f02f709518e3d3e4426209666a1e5d49e0bdea | |
parent | 09fde153ba7a68715dcad3b53cbbb8804c3d2356 (diff) |
opt: fix gcc -O3 warnings.
-rw-r--r-- | ccan/opt/test/run-iter.c | 2 | ||||
-rw-r--r-- | ccan/opt/test/utils.c | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/ccan/opt/test/run-iter.c b/ccan/opt/test/run-iter.c index 36e2c33c..a7cfb746 100644 --- a/ccan/opt/test/run-iter.c +++ b/ccan/opt/test/run-iter.c @@ -20,7 +20,7 @@ static void reset_options(void) /* Test iterators. */ int main(int argc, char *argv[]) { - unsigned j, i, len; + unsigned j, i, len = 0; const char *p; plan_tests(37 * 2); diff --git a/ccan/opt/test/utils.c b/ccan/opt/test/utils.c index 5b054f87..802b1538 100644 --- a/ccan/opt/test/utils.c +++ b/ccan/opt/test/utils.c @@ -35,7 +35,9 @@ static void save_err_output(const char *fmt, ...) char *p; va_start(ap, fmt); - vasprintf(&p, fmt, ap); + /* Check return, for fascist gcc */ + if (vasprintf(&p, fmt, ap) == -1) + p = NULL; va_end(ap); if (err_output) { |