aboutsummaryrefslogtreecommitdiffstats
path: root/src/mkheader.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mkheader.c')
-rw-r--r--src/mkheader.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mkheader.c b/src/mkheader.c
index 5aeb1e7..997cab5 100644
--- a/src/mkheader.c
+++ b/src/mkheader.c
@@ -52,14 +52,15 @@ static char *
xstrdup (const char *string)
{
char *p;
+ size_t len = strlen (string) + 1;
- p = malloc (strlen (string)+1);
+ p = malloc (len);
if (!p)
{
fputs (PGM ": out of core\n", stderr);
exit (1);
}
- strcpy (p, string);
+ memcpy (p, string, len);
return p;
}