From 2703a2c8ff87c18610534f2ba2acd15fda8acb9b Mon Sep 17 00:00:00 2001 From: sfan5 Date: Mon, 9 Jan 2023 16:52:45 +0100 Subject: video: replace sprintf usage --- video/out/vo_tct.c | 2 +- video/out/x11_common.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'video/out') diff --git a/video/out/vo_tct.c b/video/out/vo_tct.c index 209515bd84..abe749db13 100644 --- a/video/out/vo_tct.c +++ b/video/out/vo_tct.c @@ -297,7 +297,7 @@ static int preinit(struct vo *vo) for (int i = 0; i < 256; ++i) { char buff[8]; - p->lut[i].width = sprintf(buff, ";%d", i); + p->lut[i].width = snprintf(buff, sizeof(buff), ";%d", i); memcpy(p->lut[i].str, buff, 4); // some strings may not end on a null byte, but that's ok. } diff --git a/video/out/x11_common.c b/video/out/x11_common.c index c61bab7497..01611e0326 100644 --- a/video/out/x11_common.c +++ b/video/out/x11_common.c @@ -2250,7 +2250,7 @@ bool vo_x11_screen_is_composited(struct vo *vo) { struct vo_x11_state *x11 = vo->x11; char buf[50]; - sprintf(buf, "_NET_WM_CM_S%d", x11->screen); + sprintf(buf, sizeof(buf), "_NET_WM_CM_S%d", x11->screen); Atom NET_WM_CM = XInternAtom(x11->display, buf, False); return XGetSelectionOwner(x11->display, NET_WM_CM) != None; } -- cgit v1.2.3