aboutsummaryrefslogtreecommitdiff
path: root/getcore.c
diff options
context:
space:
mode:
authorDavid Phillips <dbphillipsnz@gmail.com>2015-09-01 19:19:24 +1200
committerDavid Phillips <dbphillipsnz@gmail.com>2015-09-01 19:19:24 +1200
commitdec1efba06aeadcd9a4f13e8591f2efa016a24a0 (patch)
tree1293bc4cf8bc8a5acd3f9aef5fbc7215f3689983 /getcore.c
parent93b76533735fc1d9fd666787acd65db8507d9119 (diff)
downloadparamano-dec1efba06aeadcd9a4f13e8591f2efa016a24a0.tar.xz
Replace asprintf calls with snprintf
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);
}