Ignore:
Timestamp:
03/15/21 15:57:32 (3 years ago)
Author:
Maciej Komosinski
Message:

Avoided potentially dangerous subtraction from unsigned int

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/genetics/fS/fS_general.cpp

    r1056 r1108  
    684684
    685685                int genoStart = modeSeparatorIndex + 1;
    686                 Substring substring(geno.c_str(), genoStart, geno.length() - genoStart);
     686                Substring substring(geno.c_str(), genoStart, int(geno.length()) - genoStart);
    687687                startNode = new Node(substring, nullptr, genotypeParams);
    688688                validateNeuroInputs();
     
    853853{
    854854        vector<Node*> allNodes = getAllNodes();
    855         return allNodes[fromIndex + rndUint(allNodes.size() - fromIndex)];
     855        return allNodes[fromIndex + rndUint(int(allNodes.size()) - fromIndex)];
    856856}
    857857
Note: See TracChangeset for help on using the changeset viewer.