Changeset 96258 in vbox for trunk/src/VBox/Runtime/common/string/strstr.cpp
- Timestamp:
- Aug 17, 2022 11:02:48 AM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/string/strstr.cpp
r96043 r96258 45 45 { 46 46 char const ch0Sub = *pszSubStr; 47 pszString = strchr(pszString, ch0Sub); 48 if (pszString) 47 if (ch0Sub != '\0') 49 48 { 50 size_t const cchSubStr = strlen(pszSubStr);51 do49 pszString = strchr(pszString, ch0Sub); 50 if (pszString) 52 51 { 53 if (strncmp(pszString, pszSubStr, cchSubStr) == 0) 54 return (char *)pszString; 55 if (ch0Sub) 56 pszString = strchr(pszString + 1, ch0Sub); 57 else 58 break; 59 } while (pszString != NULL); 52 size_t const cchSubStr = strlen(pszSubStr); 53 do 54 { 55 if (strncmp(pszString, pszSubStr, cchSubStr) == 0) 56 return (char *)pszString; 57 if (ch0Sub) 58 pszString = strchr(pszString + 1, ch0Sub); 59 else 60 break; 61 } while (pszString != NULL); 62 } 63 return NULL; 60 64 } 61 return NULL;65 return (char *)pszString; 62 66 } 63 67 RT_ALIAS_AND_EXPORT_NOCRT_SYMBOL(strstr);
Note:
See TracChangeset
for help on using the changeset viewer.