input: touchscreen: nt36xxx: fix snprintf warning
authorKhusika Dhamar Gusti <mail@khusika.com>
Fri, 13 Sep 2019 16:05:32 +0000 (23:05 +0700)
committerStricted <info@stricted.net>
Mon, 21 Sep 2020 21:06:53 +0000 (21:06 +0000)
Fixes the following clang warning:

../drivers/input/touchscreen/nt36xxx/nt36xxx_mp_ctrlram.c:1293:3: error: 'snprintf' size argument is too large; destination buffer has size 32, $
                snprintf(mpcriteria, PAGE_SIZE, "novatek-mp-criteria-%04X", ts->nvt_pid);
                ^
1 error generated.

Change-Id: Ieb3331a226cb6e183aaac2f22e7e8dccf27af7fc
Signed-off-by: Khusika Dhamar Gusti <mail@khusika.com>
drivers/input/touchscreen/nt36xxx/nt36xxx_mp_ctrlram.c

index 481e643ffd552b24b3b06574f7d5f834fa2afde8..832a14da3ec6cb0763ac08ac7b1fb4720cf8136c 100755 (executable)
@@ -1426,7 +1426,7 @@ static int32_t nvt_selftest_open(struct inode *inode, struct file *file)
                 * Ex. nvt_pid = 500A
                 *     mpcriteria = "novatek-mp-criteria-500A"
                 */
-               snprintf(mpcriteria, PAGE_SIZE, "novatek-mp-criteria-%04X", ts->nvt_pid);
+               snprintf(mpcriteria, sizeof(mpcriteria), "novatek-mp-criteria-%04X", ts->nvt_pid);
 
                nvt_mp_parse_dt(np, mpcriteria);
        } else {