diff options
author | Chris Hall <chris.hall@highwayman.com> | 2011-03-29 01:49:16 +0100 |
---|---|---|
committer | Chris Hall <chris.hall@highwayman.com> | 2011-03-29 01:49:16 +0100 |
commit | f9956b9524ddafdb9d0cec042213eaa8229aad8c (patch) | |
tree | bf362c892837ef3f5a6a4d4265eb18e1b47ccf33 /lib/log.c | |
parent | 9470cb2c32eab220f796b1438b787528272cbe84 (diff) | |
download | quagga-ex15p.tar.bz2 quagga-ex15p.tar.xz |
Bring "ex" version up to date with 0.99.18ex15p
Release: 0.99.18ex15p -- Pipework Branch
Also fixes issue with unknown attributes -- does not release them prematurely.
Contains the "bgpd: New show commands for improved view and address family
support", which is post 0.99.18. (But not RFC 5082 GTSM.)
Diffstat (limited to 'lib/log.c')
-rw-r--r-- | lib/log.c | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -306,6 +306,8 @@ zlog (struct zlog *zl, int priority, const char *format, ...) /*------------------------------------------------------------------------------ * Preparation of line to send to logging: file, stdout or "monitor" terminals. + * + * Line ends in '\n', but no terminating '\0'. */ static void uvzlog_line(logline ll, struct zlog *zl, int priority, @@ -314,7 +316,7 @@ uvzlog_line(logline ll, struct zlog *zl, int priority, const char* q ; qf_str_t qfs ; - qfs_init(qfs, ll->line, sizeof(ll->line) - 1) ; /* leave space for '\n' */ + qfs_init(qfs, ll->line, sizeof(ll->line)) ; /* "<time stamp>" */ uquagga_timestamp(qfs, (zl != NULL) ? zl->timestamp_precision : 0) ; @@ -339,8 +341,13 @@ uvzlog_line(logline ll, struct zlog *zl, int priority, /* Now the log line itself (uses a *copy* of the va_list) */ qfs_vprintf(qfs, format, va) ; - /* Set pointer to where the '\n' is going */ + /* Stick '\n' on the end */ qfs_append_n(qfs, "\n", 1) ; + + /* Worry about overflow of message */ + if (qfs_overflow(qfs) != 0) + qfs_term_string(qfs, "...\n", sizeof("...\n") - 1) ; + ll->len = qfs_len(qfs) ; } ; |