File: 03_format-strings.patch

package info (click to toggle)
procinfo 1%3A2.0.304-8
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 552 kB
  • sloc: cpp: 1,633; sh: 153; perl: 84; ansic: 28; makefile: 27
file content (14 lines) | stat: -rw-r--r-- 394 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Description: Ensure format strings are literals
Author: Stephen Kitt <skitt@debian.org>

--- a/procinfo.cpp
+++ b/procinfo.cpp
@@ -211,7 +211,7 @@
 	try {
 		rows = getNetStats(perSecond, showTotals, skipIfaces, elapsed);
 	} catch (string exceptionMessage) {
-		print(exceptionMessage.c_str());
+		print("%s", exceptionMessage.c_str());
 	}
 	print("\n");
 	prettyPrint(rows, rowWidth, true);