From 10a8db4bedc18df8f8ef14733c6e35b38ca4ef12 Mon Sep 17 00:00:00 2001 From: hunt Date: Tue, 11 Apr 2006 05:13:46 +0000 Subject: 2006-04-10 Martin Hunt * string.c (_stp_string_cat_cstr): No need to copy terminating 0. --- runtime/ChangeLog | 3 +++ runtime/string.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'runtime') diff --git a/runtime/ChangeLog b/runtime/ChangeLog index 59de5332..04e02ce7 100644 --- a/runtime/ChangeLog +++ b/runtime/ChangeLog @@ -1,5 +1,8 @@ 2006-04-10 Martin Hunt + * string.c (_stp_string_cat_cstr): No need to copy + terminating 0. + * vsprintf.c (_stp_snprintf): New function. * stat-common.c (_stp_stat_print_histogram): Write a diff --git a/runtime/string.c b/runtime/string.c index efb4d595..fa8e2dda 100644 --- a/runtime/string.c +++ b/runtime/string.c @@ -134,7 +134,7 @@ 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]; - memcpy (buf, str2, num + 1); + memcpy (buf, str2, num); _stp_pbuf_len[cpu] += num; } else { int size = STP_STRING_SIZE - str1->len - 1; -- cgit