From dec1efba06aeadcd9a4f13e8591f2efa016a24a0 Mon Sep 17 00:00:00 2001 From: David Phillips Date: Tue, 1 Sep 2015 19:19:24 +1200 Subject: Replace asprintf calls with snprintf --- getcore.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'getcore.c') diff --git a/getcore.c b/getcore.c index 4c7bd32..2c25c75 100644 --- a/getcore.c +++ b/getcore.c @@ -25,11 +25,10 @@ static unsigned int cores; **********************************************************************/ bool core_exists(unsigned int core) { - char* path; + char path[1024]; int result; - asprintf(&path, "/sys/devices/system/cpu/cpu%d/cpufreq", core); + snprintf(path, sizeof(path), "/sys/devices/system/cpu/cpu%d/cpufreq", core); result = access(path, F_OK); - free (path); return (result != -1); } -- cgit v1.1