]> granicus.if.org Git - clang/commitdiff
Use strncmp correctly.
authorTed Kremenek <kremenek@apple.com>
Tue, 6 May 2008 06:17:42 +0000 (06:17 +0000)
committerTed Kremenek <kremenek@apple.com>
Tue, 6 May 2008 06:17:42 +0000 (06:17 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50715 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/CFRefCount.cpp

index 455ac78be27a6505db4bec3290e32b699850e1cd..61325b6d0112ffe09ddbb78bd24431ccef8edca8 100644 (file)
@@ -531,7 +531,7 @@ RetainSummary* RetainSummaryManager::getMethodSummary(Selector S) {
 
   const char* s = S.getIdentifierInfoForSlot(0)->getName();
   
-  if (!strncmp(s, "init", 4))
+  if (strncmp(s, "init", 4) == 0)
     return getInitMethodSummary(S);
 
   return 0;
@@ -624,7 +624,7 @@ RetainSummaryManager::getInstanceMethodSummary(IdentifierInfo* ClsName,
   unsigned len = strlen(cls);
 
   // Prefix matches?
-  if (strncmp(cls, s, len))
+  if (strncmp(cls, s, len) != 0)
     return 0;
   
   s += len;  
@@ -636,7 +636,7 @@ RetainSummaryManager::getInstanceMethodSummary(IdentifierInfo* ClsName,
     if (s[0] == '\0')
       break;
   
-    if (!strncmp(s, "With", 4))
+    if (strncmp(s, "With", 4) == 0)
       break;
     
     return 0;