diff options
-rw-r--r-- | runtime/ChangeLog | 4 | ||||
-rw-r--r-- | runtime/map.c | 4 | ||||
-rw-r--r-- | runtime/string.c | 4 |
3 files changed, 8 insertions, 4 deletions
diff --git a/runtime/ChangeLog b/runtime/ChangeLog index 96ad8647..e9193caf 100644 --- a/runtime/ChangeLog +++ b/runtime/ChangeLog @@ -1,3 +1,7 @@ +2006-03-30 Martin Hunt <hunt@redhat.com> + + * string.c (_stp_string_cat_cstr): Use memcpy() instead of strncpy(). + 2006-03-26 Martin Hunt <hunt@redhat.com> * bench2/bench.rb (Bench::run): Instead of loading the module diff --git a/runtime/map.c b/runtime/map.c index 1e9fd62a..326f95aa 100644 --- a/runtime/map.c +++ b/runtime/map.c @@ -42,7 +42,7 @@ void str_copy(char *dest, char *src) int len = strlen(src); if (len > MAP_STRING_LENGTH - 1) len = MAP_STRING_LENGTH - 1; - strncpy (dest, src, len); + memcpy (dest, src, len); dest[len] = 0; } @@ -55,7 +55,7 @@ void str_add(void *dest, char *val) if (len > num) len = num; - strncpy (&dst[len1], val, len); + memcpy (&dst[len1], val, len); dst[len + len1] = 0; } diff --git a/runtime/string.c b/runtime/string.c index 2243aa53..f3e88ea3 100644 --- a/runtime/string.c +++ b/runtime/string.c @@ -134,13 +134,13 @@ void _stp_string_cat_cstr (String str1, const char *str2) num = STP_PRINT_BUF_LEN; } buf = &_stp_pbuf[cpu][STP_PRINT_BUF_START] + _stp_pbuf_len[cpu]; - strncpy (buf, str2, num + 1); + memcpy (buf, str2, num + 1); _stp_pbuf_len[cpu] += num; } else { int size = STP_STRING_SIZE - str1->len - 1; if (num > size) num = size; - strncpy (str1->buf + str1->len, str2, num); + memcpy (str1->buf + str1->len, str2, num); str1->len += num; str1->buf[str1->len] = 0; } |