r23755 by jghali - Fix coverity 1463123: Unchecked return value
scribus-commit
scribus-commit at lists.scribus.net
Sun May 10 22:48:32 UTC 2020
Author: jghali
Date: Sun May 10 22:48:32 2020
New Revision: 23755
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=23755
Log:
Fix coverity 1463123: Unchecked return value
Modified:
trunk/Scribus/scribus/plugins/barcodegenerator/barcode.cpp
Modified: trunk/Scribus/scribus/plugins/barcodegenerator/barcode.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23755&path=/trunk/Scribus/scribus/plugins/barcodegenerator/barcode.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/barcodegenerator/barcode.cpp (original)
+++ trunk/Scribus/scribus/plugins/barcodegenerator/barcode.cpp Sun May 10 22:48:32 2020
@@ -53,14 +53,16 @@
// Extract the version information from BWIPP
QFile f( ScPaths::instance().shareDir() + QString("/plugins/barcode.ps") );
- if(f.open(QIODevice::ReadOnly))
+ if (f.open(QIODevice::ReadOnly))
{
QTextStream ts(&f);
QString bwipp = ts.read(150);
f.close();
QRegExp rx("\\n% Barcode Writer in Pure PostScript - Version ([\\d-]+)\\n");
- rx.indexIn(bwipp);
- about->version = "Backend: "+rx.cap(1);
+ if (rx.indexIn(bwipp) >= 0)
+ about->version = "Backend: " + rx.cap(1);
+ else
+ about->version = "Backend: Unknown";
}
else
about->version = "Unable to open backend file";
More information about the scribus-commit
mailing list