From a46581a35ef3c34de997e0c4e460eb0415fcbb3d Mon Sep 17 00:00:00 2001 From: Baruch Even Date: Wed, 6 Aug 2014 07:24:59 +0300 Subject: [PATCH] Move initialization closer to use Should make it a bit more readable, the variable is used before that case as well but doesn't require the zero initialization in that case. --- capn-stream.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/capn-stream.c b/capn-stream.c index a8eeced..2623835 100644 --- a/capn-stream.c +++ b/capn-stream.c @@ -12,7 +12,7 @@ int capn_deflate(struct capn_stream* s) { } while (s->avail_in) { - int i, sz = 0; + int i, sz; uint8_t hdr = 0; uint8_t *p; @@ -33,6 +33,7 @@ int capn_deflate(struct capn_stream* s) { if (s->avail_in < 8) return CAPN_NEED_MORE; + sz = 0; for (i = 0; i < 8; i++) { if (s->next_in[i]) { sz ++;