diff options
author | David Phillips <dbphillipsnz@gmail.com> | 2015-09-01 19:19:24 +1200 |
---|---|---|
committer | David Phillips <dbphillipsnz@gmail.com> | 2015-09-01 19:19:24 +1200 |
commit | dec1efba06aeadcd9a4f13e8591f2efa016a24a0 (patch) | |
tree | 1293bc4cf8bc8a5acd3f9aef5fbc7215f3689983 /getcore.c | |
parent | 93b76533735fc1d9fd666787acd65db8507d9119 (diff) | |
download | paramano-dec1efba06aeadcd9a4f13e8591f2efa016a24a0.tar.xz |
Replace asprintf calls with snprintf
Diffstat (limited to 'getcore.c')
-rw-r--r-- | getcore.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -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); } |