Reduce variable scope to make cppcheck happy.
authorEmil Mikulic <emikulic@gmail.com>
Tue, 7 Jan 2014 14:55:12 +0000 (01:55 +1100)
committerEmil Mikulic <emikulic@gmail.com>
Fri, 14 Mar 2014 10:52:59 +0000 (21:52 +1100)
darkhttpd.c

index 7ce3c53..b688caf 100644 (file)
@@ -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;