diff options
author | Otto Moerbeek <otto@cvs.openbsd.org> | 2008-12-12 11:41:00 +0000 |
---|---|---|
committer | Otto Moerbeek <otto@cvs.openbsd.org> | 2008-12-12 11:41:00 +0000 |
commit | ab7b4d12e46b015ff5a2264ba30ef4dc1489e775 (patch) | |
tree | ef1bccde3f23ced27b88db5076d71576e2f12a1d /lib/libc/gdtoa/strtodg.c | |
parent | 759bd710f8aa6aa1461daba4e86d7f5186c60176 (diff) |
strcpy -> strlcpy; ok mbalmer@ martynas@
Diffstat (limited to 'lib/libc/gdtoa/strtodg.c')
-rw-r--r-- | lib/libc/gdtoa/strtodg.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libc/gdtoa/strtodg.c b/lib/libc/gdtoa/strtodg.c index 41ead32decb..159d3c91bae 100644 --- a/lib/libc/gdtoa/strtodg.c +++ b/lib/libc/gdtoa/strtodg.c @@ -338,9 +338,11 @@ strtodg char *decimalpoint; static char *decimalpoint_cache; if (!(s0 = decimalpoint_cache)) { + size_t len; s0 = localeconv()->decimal_point; - if ((decimalpoint_cache = (char*)malloc(strlen(s0) + 1))) { - strcpy(decimalpoint_cache, s0); + len = strlen(s0) + 1; + if ((decimalpoint_cache = (char*)malloc(len))) { + strlcpy(decimalpoint_cache, s0, len); s0 = decimalpoint_cache; } } |