numatop/0010-common-reg-Add-pragmas-to-silence-false-positive-war.patch

45 lines
1.2 KiB
Diff
Raw Normal View History

From 5509f2830b5376ff24690b7bed076053db25232c Mon Sep 17 00:00:00 2001
From: Colin Ian King <colin.i.king@gmail.com>
Date: Fri, 3 Dec 2021 19:37:30 +0000
Subject: [PATCH 10/32] common/reg: Add pragmas to silence false positive
warnings
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
common/reg.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/common/reg.c b/common/reg.c
index 1a87161..4a2875c 100644
--- a/common/reg.c
+++ b/common/reg.c
@@ -239,9 +239,12 @@ reg_line_write(win_reg_t *r, int line, reg_align_t align, char *content)
pos_x = (r->ncols_scr - len) / 2;
}
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-security"
if (len > 0) {
(void) mvwprintw(r->hdl, line, pos_x, content);
}
+#pragma GCC diagnostic pop
if (r->mode != 0) {
(void) wattroff(r->hdl, r->mode);
@@ -266,9 +269,12 @@ reg_highlight_write(win_reg_t *r, int line, int align, char *content)
pos_x = (r->ncols_scr - len) / 2;
}
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-security"
if (len > 0) {
(void) mvwprintw(r->hdl, line, pos_x, content);
}
+#pragma GCC diagnostic pop
(void) wattroff(r->hdl, A_REVERSE | A_BOLD);
}
--
2.41.0