Commit 74603f5e authored by Andreas Schuh's avatar Andreas Schuh

fix: Static code analyzer error regarding strncmp with empty kRootDir string

parent 4a694e87
......@@ -591,7 +591,7 @@ const char* CommandLineFlag::CleanFileName() const {
const char* clean_name = filename() + strlen(filename()) - 1;
while ( clean_name > filename() ) {
if (*clean_name == PATH_SEPARATOR) {
if (strncmp(clean_name, kRootDir, sizeof(kRootDir)-1) == 0) {
if (sizeof(kRootDir) > 1 && strncmp(clean_name, kRootDir, sizeof(kRootDir)-1) == 0) {
clean_name += sizeof(kRootDir)-1; // past root-dir
break;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment