🐛 Fix: lagi: Don't close iconv_t if it is iconv_invalid
When certain iconv_t is invalid, iconv_invalid(0xfffffffffffffffffffffff) will be returned. Passing it to iconv_close will cause a SIGSEGV.
This commit is contained in:
parent
71894fd769
commit
a2fc4bf479
1 changed files with 1 additions and 1 deletions
|
@ -420,7 +420,7 @@ size_t IconvWrapper::DstStrLen(const char* str) {
|
|||
bool IsConversionSupported(const char *src, const char *dst) {
|
||||
iconv_t cd = iconv_open(dst, src);
|
||||
bool supported = cd != iconv_invalid;
|
||||
iconv_close(cd);
|
||||
if (supported) iconv_close(cd);
|
||||
return supported;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue