]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2726] Reduce variable scope
authorMichal 'vorner' Vaner <vorner@vorner.cz>
Wed, 12 Jun 2013 09:40:39 +0000 (11:40 +0200)
committerMichal 'vorner' Vaner <vorner@vorner.cz>
Wed, 12 Jun 2013 09:40:39 +0000 (11:40 +0200)
src/lib/cc/data.cc

index af3602abbbecc3f62e85c343b07f9d48aaaba1ce..c72fdb53df32acac899b80e0edc742b92bec248f 100644 (file)
@@ -688,10 +688,9 @@ NullElement::toJSON(std::ostream& ss) const {
 void
 StringElement::toJSON(std::ostream& ss) const {
     ss << "\"";
-    char c;
     const std::string& str = stringValue();
     for (size_t i = 0; i < str.size(); ++i) {
-        c = str[i];
+        char c = str[i];
         // Escape characters as defined in JSON spec
         // Note that we do not escape forward slash; this
         // is allowed, but not mandatory.