summaryrefslogtreecommitdiffstats
path: root/libcutils
diff options
context:
space:
mode:
authorRaja M <raja1612.m@gmail.com>2016-04-19 23:55:14 +0530
committerRaja M <raja1612.m@gmail.com>2016-04-20 02:20:50 +0530
commita2f37e4fd719722064438d5ca34f88a7fa9a5886 (patch)
tree088acd4833aab587deb3d3b1d3c5aedfcace36d4 /libcutils
parent603df0e875a43cb045e9235b95f8a883f1722f1d (diff)
downloadcore-a2f37e4fd719722064438d5ca34f88a7fa9a5886.tar.gz
core-a2f37e4fd719722064438d5ca34f88a7fa9a5886.tar.bz2
core-a2f37e4fd719722064438d5ca34f88a7fa9a5886.zip
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
Diffstat (limited to 'libcutils')
-rw-r--r--libcutils/sched_policy.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libcutils/sched_policy.c b/libcutils/sched_policy.c
index 6bba3a7b1..7bb8223be 100644
--- a/libcutils/sched_policy.c
+++ b/libcutils/sched_policy.c
@@ -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);