diff options
-rw-r--r-- | runtime/ChangeLog | 6 | ||||
-rw-r--r-- | runtime/print.c | 2 | ||||
-rw-r--r-- | runtime/string.c | 1 |
3 files changed, 8 insertions, 1 deletions
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 <zanussi@us.ibm.com> + + 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 <fche@elastic.org> 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); |