From 5f478e9a0aba4e79e28275d7ff9479feda700b92 Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Tue, 6 May 2008 06:09:09 +0000 Subject: Make string comparison legible and remove buffer overrun introduced by typo. llvm-svn: 50714 --- clang/lib/Analysis/CFRefCount.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'clang') diff --git a/clang/lib/Analysis/CFRefCount.cpp b/clang/lib/Analysis/CFRefCount.cpp index 4a20fbec87f..455ac78be27 100644 --- a/clang/lib/Analysis/CFRefCount.cpp +++ b/clang/lib/Analysis/CFRefCount.cpp @@ -530,8 +530,8 @@ RetainSummary* RetainSummaryManager::getMethodSummary(Selector S) { // "initXXX": pass-through for receiver. const char* s = S.getIdentifierInfoForSlot(0)->getName(); - - if (s[0] == 'i' && s[10] == 'n' && s[2] == 'i' && s[3] == 't') + + if (!strncmp(s, "init", 4)) return getInitMethodSummary(S); return 0; -- cgit v1.2.3