summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortrz <trz>2005-10-14 15:59:05 +0000
committertrz <trz>2005-10-14 15:59:05 +0000
commitab9c6bcec56162979d8b387b613530861a363876 (patch)
tree88b48551d0e3b83e9355e2fe264413678967c3d2
parenta4a2cb6f89926bee2826766112f3e076f06a755c (diff)
downloadsystemtap-steved-ab9c6bcec56162979d8b387b613530861a363876.tar.gz
systemtap-steved-ab9c6bcec56162979d8b387b613530861a363876.tar.xz
systemtap-steved-ab9c6bcec56162979d8b387b613530861a363876.zip
Fix for PR 1455
-rw-r--r--runtime/ChangeLog6
-rw-r--r--runtime/print.c2
-rw-r--r--runtime/string.c1
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);