We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d81510c commit 3715814Copy full SHA for 3715814
clang-tools-extra/clang-tidy/objc/PropertyDeclarationCheck.cpp
@@ -39,8 +39,11 @@ static FixItHint generateFixItHint(const ObjCPropertyDecl *Decl,
39
auto NewName = Decl->getName().str();
40
size_t Index = 0;
41
if (Style == CategoryProperty) {
42
- Index = Name.find_first_of('_') + 1;
43
- NewName.replace(0, Index - 1, Name.substr(0, Index - 1).lower());
+ size_t UnderScorePos = Name.find_first_of('_');
+ if (UnderScorePos != llvm::StringRef::npos) {
44
+ Index = UnderScorePos + 1;
45
+ NewName.replace(0, Index - 1, Name.substr(0, Index - 1).lower());
46
+ }
47
}
48
if (Index < Name.size()) {
49
NewName[Index] = tolower(NewName[Index]);
0 commit comments