aboutsummaryrefslogtreecommitdiffstats
path: root/strftime.c
diff options
context:
space:
mode:
Diffstat (limited to 'strftime.c')
-rw-r--r--strftime.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/strftime.c b/strftime.c
index 4e7a2d1909..9c7b7421a5 100644
--- a/strftime.c
+++ b/strftime.c
@@ -243,7 +243,7 @@ rb_strftime(char *s, size_t maxsize, const char *format, const struct tm *timept
savetz = (char *) malloc(tzlen + 1);
if (savetz != NULL) {
savetzlen = tzlen + 1;
- strcpy(savetz, tz);
+ memcpy(savetz, tz, savetzlen);
}
}
tzset();
@@ -256,10 +256,10 @@ rb_strftime(char *s, size_t maxsize, const char *format, const struct tm *timept
savetz = (char *) realloc(savetz, i);
if (savetz) {
savetzlen = i;
- strcpy(savetz, tz);
+ memcpy(savetz, tz, i);
}
} else
- strcpy(savetz, tz);
+ memcpy(savetz, tz, i);
tzset();
}
#endif /* POSIX_SEMANTICS */