Changeset 96258 in vbox
- Timestamp:
- Aug 17, 2022 11:02:48 AM (2 years ago)
- Location:
- trunk/src/VBox/Runtime
- Files:
-
- 2 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); -
trunk/src/VBox/Runtime/testcase/tstUtf8.cpp
r95044 r96258 1121 1121 const char *pszRet = expr; \ 1122 1122 if (pszRet != NULL) \ 1123 RTTestFailed(hTest, "%d: % #x-> %s expected NULL", __LINE__, #expr, pszRet); \1123 RTTestFailed(hTest, "%d: %s -> %s expected NULL", __LINE__, #expr, pszRet); \ 1124 1124 } while (0) 1125 1125 1126 1126 #define CHECK(expr, expect) \ 1127 1127 do { \ 1128 const char * pszRet = expr; \1129 const char * pszExpect = (expect); \1128 const char * const pszRet = expr; \ 1129 const char * const pszExpect = (expect); \ 1130 1130 if ( (pszRet != NULL && pszExpect == NULL) \ 1131 1131 || (pszRet == NULL && pszExpect != NULL) \ 1132 1132 || strcmp(pszRet, pszExpect) \ 1133 1133 ) \ 1134 RTTestFailed(hTest, "%d: % #x-> %s expected %s", __LINE__, #expr, pszRet, pszExpect); \1134 RTTestFailed(hTest, "%d: %s -> %s expected %s", __LINE__, #expr, pszRet, pszExpect); \ 1135 1135 } while (0) 1136 1136
Note:
See TracChangeset
for help on using the changeset viewer.