diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2009-10-16 09:50:46 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2009-10-16 09:50:46 +0200 |
commit | a4344f350151cdb9172897709fa08680ec8587ba (patch) | |
tree | ac847ae140a62397ad5f8e8938e7fc6b6a8f90e1 /runtime/debug.c | |
parent | 73f83d963bc8084a3efc186a383493cbcbc7886e (diff) | |
parent | e005c5569c3e0c7c9a098036b7ec3596c3c722b4 (diff) | |
download | rsyslog-a4344f350151cdb9172897709fa08680ec8587ba.tar.gz rsyslog-a4344f350151cdb9172897709fa08680ec8587ba.tar.bz2 rsyslog-a4344f350151cdb9172897709fa08680ec8587ba.zip |
Merge branch 'master' into newqueue
Conflicts:
ChangeLog
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); } |