[Xfce4-commits] [apps/xfce4-terminal] 01/01: Resolve gcc8 -Wstringop-truncation warnings

noreply at xfce.org noreply at xfce.org
Mon May 14 03:28:33 CEST 2018


This is an automated email from the git hooks/post-receive script.

f   2   4   0   4       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository apps/xfce4-terminal.

commit 9f00bce95ed5677564c9e116c1deafbf439dc240
Author: Igor <f2404 at yandex.ru>
Date:   Sun May 13 21:27:34 2018 -0400

    Resolve gcc8 -Wstringop-truncation warnings
    
    As recommended at https://gcc.gnu.org/onlinedocs/gcc-8.1.0/gcc/Warning-Options.html#index-Wstringop-truncation
---
 terminal/terminal-window.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/terminal/terminal-window.c b/terminal/terminal-window.c
index 1a484cc..bb45593 100644
--- a/terminal/terminal-window.c
+++ b/terminal/terminal-window.c
@@ -478,9 +478,9 @@ G_GNUC_BEGIN_IGNORE_DEPRECATIONS
     const gchar *p2 = strstr (p1 + 1, "<menuitem action=\"paste\"/>"); // context menu
     const guint length_new = terminal_window_ui_length + 2 * strlen ("<menuitem action=\"copy-html\"/>");
     gchar *ui_new = g_new0 (gchar, length_new + 1);
-    strncpy (ui_new, terminal_window_ui, p1 - terminal_window_ui);
+    memcpy (ui_new, terminal_window_ui, p1 - terminal_window_ui);
     strcat (ui_new, "<menuitem action=\"copy-html\"/>");
-    strncat (ui_new, p1, p2 - p1);
+    memcpy (ui_new + strlen (ui_new), p1, p2 - p1);
     strcat (ui_new, "<menuitem action=\"copy-html\"/>");
     strcat (ui_new, p2);
     gtk_ui_manager_add_ui_from_string (window->priv->ui_manager, ui_new, length_new, NULL);

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list