r23724 by jghali - Fix coverity 1463231: Unchecked return value

scribus-commit scribus-commit at lists.scribus.net
Sun May 10 12:19:34 UTC 2020


Author: jghali
Date: Sun May 10 12:19:34 2020
New Revision: 23724

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=23724
Log:
Fix coverity 1463231: Unchecked return value

Modified:
    trunk/Scribus/scribus/plugins/barcodegenerator/barcodegenerator.cpp

Modified: trunk/Scribus/scribus/plugins/barcodegenerator/barcodegenerator.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23724&path=/trunk/Scribus/scribus/plugins/barcodegenerator/barcodegenerator.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/barcodegenerator/barcodegenerator.cpp	(original)
+++ trunk/Scribus/scribus/plugins/barcodegenerator/barcodegenerator.cpp	Sun May 10 12:19:34 2020
@@ -70,7 +70,7 @@
 	int pos = 0;
 	while ( (pos = rx.indexIn(bwipp, pos)) != -1 )
 	{
-		int len=rx.matchedLength();
+		int len = rx.matchedLength();
 		QString restype=rx.cap(1);
 		QString resname=rx.cap(2);
 		QString reshead=rx.cap(3);
@@ -87,15 +87,17 @@
 						"% --EXOP:(.*)[\\r\\n]+"
 						"% --RNDR:(.*)[\\r\\n]+"
 						);
-			rxhead.indexIn(reshead);
-			resreqs[resname]=rxhead.cap(1).trimmed();
-			resdescs[resname]=rxhead.cap(2).trimmed();
-			resexams[resname]=rxhead.cap(3).trimmed();
-			resexops[resname]=rxhead.cap(4).trimmed();
-			resrndrs[resname]=rxhead.cap(5).trimmed();
-			encoderlist.append(resname);
+			if (rxhead.indexIn(reshead) >= 0)
+			{
+				resreqs[resname] = rxhead.cap(1).trimmed();
+				resdescs[resname] = rxhead.cap(2).trimmed();
+				resexams[resname] = rxhead.cap(3).trimmed();
+				resexops[resname] = rxhead.cap(4).trimmed();
+				resrndrs[resname] = rxhead.cap(5).trimmed();
+				encoderlist.append(resname);
+			}
 		}
-		pos+=len;
+		pos += len;
 	}
 
 	foreach (const QString& enc, encoderlist)




More information about the scribus-commit mailing list