Merge "More secure and compiler warning fix for sprintf into snprintf" am: 4f21555 am: e05688a
am: 2af9f2f
* commit '2af9f2fe82d05c095779957d98c6987958ee9ce8':
More secure and compiler warning fix for sprintf into snprintf
Change-Id: I738f4c0893fe0924008049c666a25d0f9bb9539f
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);