changeset 54:a724ddfaa1a7

Menu.c: strlcpy, strlcat.
author ng0@n0.is
date Fri, 03 May 2019 21:08:33 +0000
parents 611811cb990b
children 8a03fc071820
files Menu.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/Menu.c	Fri May 03 20:29:47 2019 +0000
+++ b/Menu.c	Fri May 03 21:08:33 2019 +0000
@@ -409,8 +409,10 @@
                                         UnmapMenu (menu);
                                         strbuf = (char *) malloc (
                                           strlen (ml->text) + 2);
-                                        strcpy (strbuf, ml->text);
-                                        strcat (strbuf, "\n");
+                                        strlcpy (strbuf,
+                                                 ml->text,
+                                                 sizeof (strbuf));
+                                        strlcat (strbuf, "\n", sizeof (strbuf));
                                         XStoreBytes (dpy,
                                                      strbuf,
                                                      strlen (strbuf));