Skip to content

LordOS — a free, fast and secure GNU/Linux distribution based on Debian, with its own desktop environment: display server and Wayland compositor in C, a React UI engine on QuickJS, and private native apps.

monitor.c: bound the device name in the slow hand-off log (format-truncation warning on the Pi's GCC)

Federico Pereiracf080537296d
diff --git a/server/src/remote/monitor.c b/server/src/remote/monitor.c
index ca3714c..eb5263a 100644
--- a/server/src/remote/monitor.c
+++ b/server/src/remote/monitor.c
@@ -171,7 +171,7 @@ static void take_back(void) {
ioctl(ins[i], EVIOCREVOKE, NULL);
double e = rd_now();
if (e - a > 0.05 && strlen(slow) < sizeof slow - 40)
- snprintf(slow + strlen(slow), sizeof slow - strlen(slow), " %s revoke %.0f", inname[i], (e - a) * 1000);
+ snprintf(slow + strlen(slow), sizeof slow - strlen(slow), " %.15s revoke %.0f", inname[i], (e - a) * 1000);
}
close_later(ins, nin);
nin = 0;