Fix build with "-Werror=format-security" flag (issue #845)

This commit is contained in:
Abs62 2017-05-26 19:02:42 +03:00
parent aa27ff43a1
commit 21516284a1

View file

@ -625,9 +625,7 @@ void FavoritesModel::readData()
if ( !dom.setContent( &favoritesFile, false, &errorStr, &errorLine, &errorColumn ) )
{
// Mailformed file
QString errStr;
errStr.sprintf( "Error: %s at %d,%d\n", errorStr.toLocal8Bit().constData(), errorLine, errorColumn );
gdWarning( errStr.toUtf8().data() );
gdWarning( "Favorites file parsing error: %s at %d,%d\n", errorStr.toUtf8().data(), errorLine, errorColumn );
QMessageBox mb( QMessageBox::Warning, "GoldenDict",
tr( "Error in favorities file" ),
@ -1155,9 +1153,7 @@ bool FavoritesModel::setDataFromXml( QString const & dataStr )
if ( !dom.setContent( dataStr, false, &errorStr, &errorLine, &errorColumn ) )
{
// Mailformed data
QString errStr;
errStr.sprintf( "Error: %s at %d,%d\n", errorStr.toLocal8Bit().constData(), errorLine, errorColumn );
gdWarning( errStr.toUtf8().data() );
gdWarning( "XML parsing error: %s at %d,%d\n", errorStr.toUtf8().data(), errorLine, errorColumn );
dom.clear();
return false;
}