Changeset 40091 in vbox
- Timestamp:
- Feb 13, 2012 10:14:00 AM (13 years ago)
- svn:sync-xref-src-repo-rev:
- 76231
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/string.h
r40071 r40091 711 711 * 712 712 * @returns The number of code points replaced, or a negative value if the 713 * string is not correctly encoded. In this case the string will not714 * be changed.713 * string is not correctly encoded. In this last case the string 714 * may be partially processed. 715 715 * @param psz The string to sanitise. 716 716 * @param puszValidSet A zero-terminated array of the Unicode code points … … 3325 3325 * 3326 3326 * @returns The number of code points replaced, or a negative value if the 3327 * string is not correctly encoded. In this case the string will not3328 * be changed.3327 * string is not correctly encoded. In this last case the string 3328 * may be partially processed. 3329 3329 * @param pwsz The string to sanitise. 3330 3330 * @param puszValidSet A zero-terminated array of the Unicode code points -
trunk/src/VBox/Runtime/common/string/utf-16.cpp
r40073 r40091 255 255 AssertReturn(chReplacement && (unsigned)chReplacement < 128, -1); 256 256 /* Validate the encoding. */ 257 if (RT_FAILURE(RTUtf16CalcUtf8LenEx(pwsz, RTSTR_MAX, NULL)))258 return -1;259 257 for (;;) 260 258 { … … 262 260 PCRTUNICP pCp; 263 261 PRTUTF16 pwszOld = pwsz; 264 RTUtf16GetCpEx((PCRTUTF16 *)&pwsz, &Cp); 262 if (RT_FAILURE(RTUtf16GetCpEx((PCRTUTF16 *)&pwsz, &Cp))) 263 return -1; 265 264 if (!Cp) 266 265 break; -
trunk/src/VBox/Runtime/common/string/utf-8.cpp
r40073 r40091 356 356 size_t cReplacements = 0; 357 357 AssertReturn(chReplacement && (unsigned)chReplacement < 128, -1); 358 if (RT_FAILURE(RTStrValidateEncoding(psz)))359 return -1;360 358 for (;;) 361 359 { … … 363 361 PCRTUNICP pCp; 364 362 char *pszOld = psz; 365 RTStrGetCpEx((const char **)&psz, &Cp); 363 if (RT_FAILURE(RTStrGetCpEx((const char **)&psz, &Cp))) 364 return -1; 366 365 if (!Cp) 367 366 break;
Note:
See TracChangeset
for help on using the changeset viewer.