Storing a size_t returned from std::string in an int and checking for negative is weird.

This commit is contained in:
KentuckyCompass
2012-12-27 04:23:04 -08:00
parent 928150fbf4
commit 725094eaef

View File

@@ -78,8 +78,8 @@ bool DirectoryFileSystem::RenameFile(const std::string &from, const std::string
std::string fullTo = to;
// TO filename may not include path. Intention is that it uses FROM's path
if (to.find("/") != std::string::npos) {
int offset = from.find_last_of("/");
if (offset >= 0) {
size_t offset = from.find_last_of("/");
if (offset != std::string::npos) {
fullTo = from.substr(0, offset + 1) + to;
}
}