summaryrefslogtreecommitdiff
path: root/font.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2023-01-14 12:42:33 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2023-01-14 16:12:24 -0800
commit0ca4db4996abd5e6161567575fe318663d8dd117 (patch)
tree80617e77b53fc9963d96c44e17c5f42a7ef4fbc3 /font.c
parent42e0ce4adc008430e32c54a5374b7744c2c2cfe4 (diff)
Replace strcpy() calls with strncpy() or memcpy()
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'font.c')
-rw-r--r--font.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/font.c b/font.c
index 3ad54f6..36e6776 100644
--- a/font.c
+++ b/font.c
@@ -16,13 +16,15 @@
static char *
savestr(const char *s)
{
- char *n;
+ size_t len;
+ char * n;
if (!s)
return NULL;
- n = XtMalloc(strlen(s) + 1);
+ len = strlen(s) + 1;
+ n = XtMalloc (len);
if (n)
- strcpy(n, s);
+ memcpy(n, s, len);
return n;
}