From ab9c6bcec56162979d8b387b613530861a363876 Mon Sep 17 00:00:00 2001 From: trz Date: Fri, 14 Oct 2005 15:59:05 +0000 Subject: Fix for PR 1455 --- runtime/ChangeLog | 6 ++++++ runtime/print.c | 2 +- runtime/string.c | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) (limited to 'runtime') diff --git a/runtime/ChangeLog b/runtime/ChangeLog index 196d9486..abe2e64c 100644 --- a/runtime/ChangeLog +++ b/runtime/ChangeLog @@ -1,3 +1,9 @@ +2005-10-14 Tom Zanussi + + PR 1455 + * string.c (_stp_sprintf): Restore overwritten NULL byte. + * print.c: Change STP_PRINT_BUF_LEN to correct size. + 2005-10-06 Frank Ch. Eigler PR 1332. diff --git a/runtime/print.c b/runtime/print.c index 794cd273..49040c2d 100644 --- a/runtime/print.c +++ b/runtime/print.c @@ -66,7 +66,7 @@ void _stp_print_flush (void) /** Size of buffer, not including terminating NULL */ #ifndef STP_PRINT_BUF_LEN -#define STP_PRINT_BUF_LEN (8192 - TIMESTAMP_SIZE - 2) +#define STP_PRINT_BUF_LEN (8192 - TIMESTAMP_SIZE - 1) #endif static char _stp_pbuf[NR_CPUS][STP_PRINT_BUF_LEN + STP_PRINT_BUF_START + 1]; diff --git a/runtime/string.c b/runtime/string.c index ef715b40..b4c14d01 100644 --- a/runtime/string.c +++ b/runtime/string.c @@ -62,6 +62,7 @@ void _stp_sprintf (String str, const char *fmt, ...) _stp_pbuf_len[cpu] = STP_PRINT_BUF_LEN; _stp_print_flush(); } else { + *buf ='\0'; _stp_print_flush(); va_start(args, fmt); _stp_vsprintf(_stp_stdout, fmt, args); -- cgit