From 2e2af79801a9cdb1dace870b0ba6633a7d5ab74d Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Tue, 4 Mar 2025 18:01:43 +0100 Subject: [PATCH] use asprintf() instead of Xasprintf() All our supported platforms should have asprintf(), so we don't need the Xserver's own implementation anymore. It's one of two drivers blocking removal of this function form server ABI. Signed-off-by: Enrico Weigelt, metux IT consult --- src/smi_video.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/smi_video.c b/src/smi_video.c index b0319ac..3ea6e87 100644 --- a/src/smi_video.c +++ b/src/smi_video.c @@ -53,6 +53,11 @@ authorization from the XFree86 Project and silicon Motion. #include "config.h" #endif +#ifndef _GNU_SOURCE +#define _GNU_SOURCE +#endif +#include + #include "smi.h" #include "smi_video.h" @@ -519,7 +524,7 @@ SMI_AddEncoding(XF86VideoEncodingPtr enc, int i, norm_string = VideoNorms[norm].name; input_string = VideoInputs[input].name; snprintf(channel_string, sizeof(channel_string), "%d", channel); - if (Xasprintf(&name_string, "%s-%s-%s", + if (asprintf(&name_string, "%s-%s-%s", norm_string, input_string, channel_string) < 0) LEAVE(-1);