Merge "More secure and compiler warning fix for sprintf into snprintf" am: 4f21555
am: e05688a
* commit 'e05688a176c27025d59c0a512501a411b56f1bb1':
More secure and compiler warning fix for sprintf into snprintf
Change-Id: I93d4ff6d1c2674113d481ff06170d19f31951346
diff --git a/libcutils/sched_policy.c b/libcutils/sched_policy.c
index b399643..884ee17 100644
--- a/libcutils/sched_policy.c
+++ b/libcutils/sched_policy.c
@@ -337,7 +337,7 @@
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);