From d054f0a4d451120c26494263fc4dc175bfd405b1 Mon Sep 17 00:00:00 2001 From: Daniel Mack Date: Tue, 12 Jan 2016 15:34:20 +0100 Subject: tree-wide: use xsprintf() where applicable Also add a coccinelle receipt to help with such transitions. --- src/cgtop/cgtop.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/cgtop') 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) -- cgit v1.2.3-54-g00ecf