Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a2f37e4f authored by Raja M's avatar Raja M
Browse files

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
parent 603df0e8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);