aboutsummaryrefslogtreecommitdiff
path: root/getcore.c
diff options
context:
space:
mode:
Diffstat (limited to 'getcore.c')
-rw-r--r--getcore.c5
1 files changed, 2 insertions, 3 deletions
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);
}