mirror of
https://gitlab.freedesktop.org/uchardet/uchardet.git
synced 2025-12-06 16:56:40 +08:00
uchardet_get_charset() should never return NULL...
... to stay backward compatible with previous behavior. About detection failure, our in-code documentation says: "@return name of charset on success and "" on failure or pure ascii." This behavior had been broken by commit 3a518c0, which returned NULL instead. Our command-line tool was the first victim, segfaulting on ASCII files.
This commit is contained in:
parent
d0ccdd5db9
commit
256d1957b2
@ -75,7 +75,7 @@ public:
|
||||
|
||||
const char* GetCharset() const
|
||||
{
|
||||
return m_charset;
|
||||
return m_charset? m_charset : "";
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user