Parcourir la source

[2992] variable definition is moved into inner scope because of cppcheck claim

fujiwara il y a 12 ans
Parent
commit
b2f0388d53
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      src/lib/cc/data.cc

+ 1 - 1
src/lib/cc/data.cc

@@ -397,13 +397,13 @@ fromStringstreamNumber(std::istream& in, int& pos) {
     double d = 0.0;
     bool is_double = false;
     char* endptr;
-    const char* ptr;
 
     std::string number = numberFromStringstream(in, pos);
 
     errno = 0;
     i = strtol(number.c_str(), &endptr, 10);
     if (*endptr != '\0') {
+        const char* ptr;
         errno = 0;
         d = strtod(ptr = number.c_str(), &endptr);
         is_double = true;