From 5a4ce877df7f4ca3fa314fd2084222011a1a3403 Mon Sep 17 00:00:00 2001 From: "Serge E. Hallyn" Date: Sun, 13 Sep 2020 22:46:52 -0500 Subject: [PATCH] screenlock: set max field width for sprintf MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Stop a compiler warning about overwriting the 100 char buffer with larger string. programs/sxmo_screenlock.c:61:3: note: ‘sprintf’ output between 39 and 294 bytes into a destination of size 100 --- programs/sxmo_screenlock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/programs/sxmo_screenlock.c b/programs/sxmo_screenlock.c index 7ee66a7..30a3e13 100644 --- a/programs/sxmo_screenlock.c +++ b/programs/sxmo_screenlock.c @@ -60,7 +60,7 @@ configuresuspendsettingsandwakeupsources() while ((wakeupsource = readdir(wakeupsources)) != NULL) { sprintf( wakeuppath, - "/sys/class/wakeup/%s/device/power/wakeup", + "/sys/class/wakeup/%.50s/device/power/wakeup", wakeupsource->d_name ); fprintf(stderr, "Disabling wakeup source: %s", wakeupsource->d_name);