summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Heidelberg <david@ixit.cz>2019-10-27 17:25:35 +0100
committerAlexander Akulich <akulichalexander@gmail.com>2020-11-01 01:53:10 +0300
commit07d021e5e1c11e9ecda0907038bb7a6fa7f18c58 (patch)
tree0a31afb84e067234b49d77430ff4b991cc4ab43c
parentc9b6a16206dd25c37ea3fc43f2b8870bfe410e52 (diff)
downloadtelepathy-idle-07d021e5e1c11e9ecda0907038bb7a6fa7f18c58.tar.gz
fix compilation on GCC 9.x, add #pragma
Fixes: In function 'strncpy', inlined from 'idle_server_connection_send_async' at idle-server-connection.c:593:2: /usr/include/bits/string_fortified.h:106:10: error: '__builtin_strncpy' specified bound 512 equals destination size [-Werror=stringop-truncation] 106 | return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors Signed-off-by: David Heidelberg <david@ixit.cz>
-rw-r--r--src/idle-server-connection.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/idle-server-connection.c b/src/idle-server-connection.c
index 878b199..c463fe0 100644
--- a/src/idle-server-connection.c
+++ b/src/idle-server-connection.c
@@ -590,7 +590,10 @@ void idle_server_connection_send_async(IdleServerConnection *conn, const gchar *
* with null bytes gives us cleaner debug messages, without
* affecting the readability of the code.
*/
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wstringop-truncation"
strncpy(priv->output_buffer, cmd, output_buffer_size);
+#pragma GCC diagnostic pop
priv->nwritten = 0;