mirror of
https://github.com/Sude-/lgogdownloader.git
synced 2024-11-20 03:39:17 +01:00
Check for errors in Util::htmlToXhtml
This commit is contained in:
parent
52b8bdc8fa
commit
b30515bfea
10
src/util.cpp
10
src/util.cpp
@ -1028,7 +1028,15 @@ std::string Util::htmlToXhtml(const std::string& html)
|
||||
if ( rc >= 0 )
|
||||
rc = tidySaveBuffer(doc, &buffer);
|
||||
|
||||
xhtml = std::string((char*)buffer.bp, buffer.size);
|
||||
if (rc >= 0)
|
||||
{
|
||||
if (buffer.size > 0)
|
||||
xhtml = std::string((char*)buffer.bp, buffer.size);
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cerr << "Severe error occured: " << std::string(strerror(rc)) << std::endl;
|
||||
}
|
||||
|
||||
tidyBufFree(&buffer);
|
||||
tidyRelease(doc);
|
||||
|
Loading…
Reference in New Issue
Block a user