projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
7623a94
)
Turbostat: replace sprintf with ssnprintf from common.h
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
128950c
..
a003ca8
100644
(file)
--- a/
src/turbostat.c
+++ b/
src/turbostat.c
@@
-273,7
+273,7
@@
get_msr(int cpu, off_t offset, unsigned long long *msr)
char pathname[32];
int fd;
char pathname[32];
int fd;
- s
printf(pathname
, "/dev/cpu/%d/msr", cpu);
+ s
snprintf(pathname, 32
, "/dev/cpu/%d/msr", cpu);
fd = open(pathname, O_RDONLY);
if (fd < 0)
return -1;
fd = open(pathname, O_RDONLY);
if (fd < 0)
return -1;
@@
-640,7
+640,7
@@
get_num_ht_siblings(int cpu)
int matches;
char character;
int matches;
char character;
- s
printf(path
, "/sys/devices/system/cpu/cpu%d/topology/thread_siblings_list", cpu);
+ s
snprintf(path, 80
, "/sys/devices/system/cpu/cpu%d/topology/thread_siblings_list", cpu);
filep = fopen(path, "r");
if (!filep) {
ERROR("%s: open failed", path);
filep = fopen(path, "r");
if (!filep) {
ERROR("%s: open failed", path);