summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7623a94)
raw | patch | inline | side by side (parent: 7623a94)
author | Vincent Brillault <git@lerya.net> | |
Thu, 21 Aug 2014 16:09:26 +0000 (18:09 +0200) | ||
committer | Vincent Brillault <git@lerya.net> | |
Sat, 28 Feb 2015 06:35:40 +0000 (07:35 +0100) |
src/turbostat.c | patch | blob | history |
diff --git a/src/turbostat.c b/src/turbostat.c
index 128950c06af1edce2837336d432a26a297935050..a003ca83787b8db1818dca21f68267e77c55da15 100644 (file)
--- a/src/turbostat.c
+++ b/src/turbostat.c
char pathname[32];
int fd;
- sprintf(pathname, "/dev/cpu/%d/msr", cpu);
+ ssnprintf(pathname, 32, "/dev/cpu/%d/msr", cpu);
fd = open(pathname, O_RDONLY);
if (fd < 0)
return -1;
int matches;
char character;
- sprintf(path, "/sys/devices/system/cpu/cpu%d/topology/thread_siblings_list", cpu);
+ ssnprintf(path, 80, "/sys/devices/system/cpu/cpu%d/topology/thread_siblings_list", cpu);
filep = fopen(path, "r");
if (!filep) {
ERROR("%s: open failed", path);