Merge "More secure and compiler warning fix for sprintf into snprintf"

This commit is contained in:
Elliott Hughes 2016-04-19 22:03:58 +00:00 committed by Gerrit Code Review
commit 4f2155518a

View file

@ -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);