diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2009-10-16 08:45:57 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2009-10-16 08:45:57 +0200 |
commit | 1e0e9e67f073a4414ac03599b4ff8994ff30bc05 (patch) | |
tree | 947238856e69d5b248b6928ae455a034705dedda /runtime/debug.c | |
parent | cd118cfcc22ea283c8d0112aeedc3f0d8b42d8a8 (diff) | |
parent | 3ed4b2cd3ebaf6f4c377ba2e03ef52c2e8a985b6 (diff) | |
download | rsyslog-1e0e9e67f073a4414ac03599b4ff8994ff30bc05.tar.gz rsyslog-1e0e9e67f073a4414ac03599b4ff8994ff30bc05.tar.xz rsyslog-1e0e9e67f073a4414ac03599b4ff8994ff30bc05.zip |
Merge branch 'david-master' into master
Conflicts:
ChangeLog
runtime/msg.c
Diffstat (limited to 'runtime/debug.c')
-rw-r--r-- | runtime/debug.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/runtime/debug.c b/runtime/debug.c index 959d56a3..476f8bf7 100644 --- a/runtime/debug.c +++ b/runtime/debug.c @@ -960,7 +960,7 @@ void dbgprintf(char *fmt, ...) { va_list ap; - char pszWriteBuf[1024]; + char pszWriteBuf[32*1024]; size_t lenWriteBuf; if(!(Debug && debugging_on)) @@ -969,6 +969,16 @@ dbgprintf(char *fmt, ...) va_start(ap, fmt); lenWriteBuf = vsnprintf(pszWriteBuf, sizeof(pszWriteBuf), fmt, ap); va_end(ap); + + if(lenWriteBuf >= sizeof(pszWriteBuf)) { + /* if we need to truncate, do it in a somewhat useful way... */ + pszWriteBuf[sizeof(pszWriteBuf) - 5] = '!'; + pszWriteBuf[sizeof(pszWriteBuf) - 4] = '.'; + pszWriteBuf[sizeof(pszWriteBuf) - 3] = '.'; + pszWriteBuf[sizeof(pszWriteBuf) - 2] = '.'; + pszWriteBuf[sizeof(pszWriteBuf) - 1] = '\n'; + lenWriteBuf = sizeof(pszWriteBuf); + } dbgprint(NULL, pszWriteBuf, lenWriteBuf); } |