More secure and compiler warning fix for sprintf into snprintf
To fix GCC WARNINGS while building. or To support error free -D_FORTIFY_SOURCE=2 strict mode compilation. Change-Id: I999bd83785456a77247e5e1d708e2bdde2eb057b
This commit is contained in:
parent
603df0e875
commit
a2f37e4fd7
|
@ -306,7 +306,7 @@ int set_sched_policy(int tid, SchedPolicy policy)
|
|||
char thread_name[255];
|
||||
int fd;
|
||||
|
||||
sprintf(statfile, "/proc/%d/stat", tid);
|
||||
snprintf(statfile, sizeof(statfile), "/proc/%d/stat", tid);
|
||||
memset(thread_name, 0, sizeof(thread_name));
|
||||
|
||||
fd = open(statfile, O_RDONLY);
|
||||
|
|
Loading…
Reference in New Issue