mirror of
https://github.com/YosysHQ/yosys
synced 2025-08-10 05:00:52 +00:00
snprintf
This commit is contained in:
parent
7b47f645d7
commit
636ce9ac2c
2 changed files with 20 additions and 20 deletions
|
@ -43,7 +43,7 @@ static inline int memReadStat(int field)
|
|||
pid_t pid = getpid();
|
||||
int value;
|
||||
|
||||
sprintf(name, "/proc/%d/statm", pid);
|
||||
snprintf(name, 256, "/proc/%d/statm", pid);
|
||||
FILE* in = fopen(name, "rb");
|
||||
if (in == NULL) return 0;
|
||||
|
||||
|
@ -60,7 +60,7 @@ static inline int memReadPeak(void)
|
|||
char name[256];
|
||||
pid_t pid = getpid();
|
||||
|
||||
sprintf(name, "/proc/%d/status", pid);
|
||||
snprintf(name, 256, "/proc/%d/status", pid);
|
||||
FILE* in = fopen(name, "rb");
|
||||
if (in == NULL) return 0;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue