From ad1f132cf210b20cc9d48ec0f9203f231a619a17 Mon Sep 17 00:00:00 2001 From: Emil Mikulic Date: Wed, 8 Jan 2014 01:55:12 +1100 Subject: [PATCH] Reduce variable scope to make cppcheck happy. --- darkhttpd.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/darkhttpd.c b/darkhttpd.c index 7ce3c53..b688caf 100644 --- a/darkhttpd.c +++ b/darkhttpd.c @@ -1421,15 +1421,16 @@ static char *parse_field(const struct connection *conn, const char *field) { * either part of the range is given. */ static void parse_range_field(struct connection *conn) { - size_t bound1, bound2, len; char *range; range = parse_field(conn, "Range: bytes="); if (range == NULL) return; - len = strlen(range); do { + size_t bound1, bound2, len; + len = strlen(range); + /* parse number up to hyphen */ bound1 = 0; for (bound2=0;