mirror of
https://github.com/transmission/transmission
synced 2025-02-21 13:46:52 +00:00
refactor: use utf8::unchecked::replace_invalid (#2259)
This works around a false Coverity uncaught-throw warning Xref: https://scan5.coverity.com/reports.htm#v48014/p10174/fileInstanceId=204756586&defectInstanceId=52315575&mergedDefectId=1494566
This commit is contained in:
parent
0583cca414
commit
933990fbfc
1 changed files with 1 additions and 1 deletions
|
@ -784,7 +784,7 @@ bool tr_utf8_validate(std::string_view sv, char const** good_end)
|
|||
static char* strip_non_utf8(std::string_view sv)
|
||||
{
|
||||
char* ret = tr_new(char, std::size(sv) + 1);
|
||||
auto const it = utf8::replace_invalid(std::data(sv), std::data(sv) + std::size(sv), ret, '?');
|
||||
auto const it = utf8::unchecked::replace_invalid(std::data(sv), std::data(sv) + std::size(sv), ret, '?');
|
||||
*it = '\0';
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue