[Lldb-commits] [lldb] r131646 - /lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp

Peter Collingbourne peter at pcc.me.uk
Thu May 19 10:34:44 PDT 2011


Author: pcc
Date: Thu May 19 12:34:44 2011
New Revision: 131646

URL: http://llvm.org/viewvc/llvm-project?rev=131646&view=rev
Log:
Use the portable memchr function instead of the BSD-only strnstr

Modified:
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp?rev=131646&r1=131645&r2=131646&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp Thu May 19 12:34:44 2011
@@ -813,10 +813,10 @@
                                 // Also see if this is a "category" on our class.  If so strip off the category name,
                                 // and add the class name without it to the basename table. 
                                 
-                                const char *first_paren = strnstr (name, "(", method_name - name);
+                                const char *first_paren = (char *) memchr (name, '(', method_name - name);
                                 if (first_paren)
                                 {
-                                    const char *second_paren = strnstr (first_paren, ")", method_name - first_paren);
+                                    const char *second_paren = (char *) memchr (first_paren, ')', method_name - first_paren);
                                     if (second_paren)
                                     {
                                         std::string buffer (name, first_paren - name);





More information about the lldb-commits mailing list