summaryrefslogtreecommitdiff
path: root/src/cgtop/cgtop.c
diff options
context:
space:
mode:
authorDaniel Mack <daniel@zonque.org>2016-01-12 15:34:20 +0100
committerDaniel Mack <daniel@zonque.org>2016-01-12 15:36:32 +0100
commitd054f0a4d451120c26494263fc4dc175bfd405b1 (patch)
tree43606871b8012973ac6f3936d4887a5c658ce097 /src/cgtop/cgtop.c
parent1f52a79d4eb0216bf1f2d96539609f02d8bb9e71 (diff)
tree-wide: use xsprintf() where applicable
Also add a coccinelle receipt to help with such transitions.
Diffstat (limited to 'src/cgtop/cgtop.c')
-rw-r--r--src/cgtop/cgtop.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/cgtop/cgtop.c b/src/cgtop/cgtop.c
index 0a5c11ad0c..4894296554 100644
--- a/src/cgtop/cgtop.c
+++ b/src/cgtop/cgtop.c
@@ -40,6 +40,7 @@
#include "parse-util.h"
#include "path-util.h"
#include "process-util.h"
+#include "stdio-util.h"
#include "terminal-util.h"
#include "unit-name.h"
#include "util.h"
@@ -565,9 +566,9 @@ static void display(Hashmap *a) {
}
if (arg_cpu_type == CPU_PERCENT)
- snprintf(buffer, sizeof(buffer), "%6s", "%CPU");
+ xsprintf(buffer, "%6s", "%CPU");
else
- snprintf(buffer, sizeof(buffer), "%*s", maxtcpu, "CPU Time");
+ xsprintf(buffer, "%*s", maxtcpu, "CPU Time");
rows = lines();
if (rows <= 10)