Re: [PATCH] ui/console-vc: Silence warning about sprintf() on OpenBSD

2024-10-15 Thread Thomas Huth
On 15/10/2024 10.14, Daniel P. Berrangé wrote: On Mon, Oct 14, 2024 at 10:50:44PM +0300, Michael Tokarev wrote: On 14.10.2024 18:15, Daniel P. Berrangé wrote: These two lines are the only place in the code that uses the char response[40]; so even better than switching to snprintf, how a

Re: [PATCH] ui/console-vc: Silence warning about sprintf() on OpenBSD

2024-10-15 Thread Daniel P . Berrangé
On Mon, Oct 14, 2024 at 10:50:44PM +0300, Michael Tokarev wrote: > On 14.10.2024 18:15, Daniel P. Berrangé wrote: > > > These two lines are the only place in the code that uses the > > > > char response[40]; > > > > so even better than switching to snprintf, how about just taking > > buffer

Re: [PATCH] ui/console-vc: Silence warning about sprintf() on OpenBSD

2024-10-15 Thread Alex Bennée
Michael Tokarev writes: > On 14.10.2024 18:15, Daniel P. Berrangé wrote: > >> These two lines are the only place in the code that uses the >> char response[40]; >> so even better than switching to snprintf, how about just taking >> buffer size out of the picture: >>g_autofree *response =

Re: [PATCH] ui/console-vc: Silence warning about sprintf() on OpenBSD

2024-10-14 Thread Marc-André Lureau
On Mon, Oct 14, 2024 at 7:10 PM Thomas Huth wrote: > > The linker on OpenBSD complains: > > ld: warning: console-vc.c:824 (../src/ui/console-vc.c:824)([...]): > warning: sprintf() is often misused, please use snprintf() > > Using snprintf() is certainly better here, so let's switch to that > fun

Re: [PATCH] ui/console-vc: Silence warning about sprintf() on OpenBSD

2024-10-14 Thread Michael Tokarev
On 14.10.2024 18:15, Daniel P. Berrangé wrote: These two lines are the only place in the code that uses the char response[40]; so even better than switching to snprintf, how about just taking buffer size out of the picture: g_autofree *response = g_strdup_printf("\033[%d;%dR",

Re: [PATCH] ui/console-vc: Silence warning about sprintf() on OpenBSD

2024-10-14 Thread Daniel P . Berrangé
On Mon, Oct 14, 2024 at 05:10:23PM +0200, Thomas Huth wrote: > The linker on OpenBSD complains: > > ld: warning: console-vc.c:824 (../src/ui/console-vc.c:824)([...]): > warning: sprintf() is often misused, please use snprintf() > > Using snprintf() is certainly better here, so let's switch to t

[PATCH] ui/console-vc: Silence warning about sprintf() on OpenBSD

2024-10-14 Thread Thomas Huth
The linker on OpenBSD complains: ld: warning: console-vc.c:824 (../src/ui/console-vc.c:824)([...]): warning: sprintf() is often misused, please use snprintf() Using snprintf() is certainly better here, so let's switch to that function instead. Signed-off-by: Thomas Huth --- ui/console-vc.c |