diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2023-01-14 12:42:33 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2023-01-14 16:12:24 -0800 |
commit | 0ca4db4996abd5e6161567575fe318663d8dd117 (patch) | |
tree | 80617e77b53fc9963d96c44e17c5f42a7ef4fbc3 /font.c | |
parent | 42e0ce4adc008430e32c54a5374b7744c2c2cfe4 (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.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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; } |