]> granicus.if.org Git - apache/commitdiff
Fix iteration over string
authorStefan Fritsch <sf@apache.org>
Sun, 28 Aug 2011 20:02:38 +0000 (20:02 +0000)
committerStefan Fritsch <sf@apache.org>
Sun, 28 Aug 2011 20:02:38 +0000 (20:02 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1162581 13f79535-47bb-0310-9956-ffa450edef68

modules/http/byterange_filter.c

index c49e35c07f9bdc7fa3b1d938b70380d4a548f707..d314c60a0d50753fe5172cf8fda346c8a9b4d0da 100644 (file)
@@ -433,7 +433,7 @@ static int ap_set_byterange(request_rec *r, apr_off_t clength,
     int in_merge = 0;
     indexes_t *idx;
     int overlaps = 0, reversals = 0;
-    int i, ranges = 1;
+    int ranges = 1;
     const char *it;
 
     if (r->assbackwards) {
@@ -492,8 +492,8 @@ static int ap_set_byterange(request_rec *r, apr_off_t clength,
     range += 6;
     or = apr_pstrdup(r->pool, range);
     it = range;
-    for (i = 0; i < strlen(it); i++) {
-        if (*it == ',') {
+    while (*it) {
+        if (*it++ == ',') {
             ranges++;
         }
     }