util-linux/backport-wall-add-__format__-attribute.patch
2024-04-01 16:51:14 +08:00

29 lines
816 B
Diff
Executable File

From 0c753d8d6b6c4342f4ede5e8aba1491d9119d010 Mon Sep 17 00:00:00 2001
From: Karel Zak <kzak@redhat.com>
Date: Fri, 18 Jun 2021 16:56:52 +0200
Subject: [PATCH] wall: add __format__ attribute
Reported-by: Jan Pazdziora <jpazdziora@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
---
term-utils/wall.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/term-utils/wall.c b/term-utils/wall.c
index 97d9a56b5..fb283d3bf 100644
--- a/term-utils/wall.c
+++ b/term-utils/wall.c
@@ -296,7 +296,8 @@ static void buf_puts(struct buffer *bs, const char *s)
bs->used += len;
}
-static void buf_printf(struct buffer *bs, const char *fmt, ...)
+static void __attribute__((__format__ (__printf__, 2, 3)))
+ buf_printf(struct buffer *bs, const char *fmt, ...)
{
int rc;
va_list ap;
--
2.19.1