diff options
author | Chris Hall <chris.hall@highwayman.com> | 2011-09-02 12:07:01 +0100 |
---|---|---|
committer | Chris Hall <chris.hall@highwayman.com> | 2011-09-02 12:07:01 +0100 |
commit | 3593a823ca0dd92bbe58aa3464d8a371f6f35e70 (patch) | |
tree | 933eadc60f5c9e16dc5d9bf6b3762870a11d1a81 /lib/log.c | |
parent | 3690074a486cfada568975e287d9cbb9e687501f (diff) | |
download | quagga-3593a823ca0dd92bbe58aa3464d8a371f6f35e70.tar.bz2 quagga-3593a823ca0dd92bbe58aa3464d8a371f6f35e70.tar.xz |
Changed gcc options to -std=c99 and -O2, and tighted warnings.
Some small changes to accomodate same.
Diffstat (limited to 'lib/log.c')
-rw-r--r-- | lib/log.c | 16 |
1 files changed, 7 insertions, 9 deletions
@@ -530,9 +530,8 @@ void _zlog_assert_failed (const char *assertion, const char *file, unsigned int line, const char *function) { - const static size_t buff_size = 1024; - char buff[buff_size]; - snprintf(buff, buff_size, + char buff[1024]; + snprintf(buff, sizeof(buff), "Assertion `%s' failed in file %s, line %u, function %s", assertion, file, line, (function ? function : "?")); zlog_abort(buff); @@ -543,9 +542,9 @@ void _zlog_abort_mess (const char *mess, const char *file, unsigned int line, const char *function) { - const static size_t buff_size = 1024; - char buff[buff_size]; - snprintf(buff, buff_size, "%s, in file %s, line %u, function %s", + char buff[1024]; + snprintf(buff, sizeof(buff), + "%s, in file %s, line %u, function %s", mess, file, line, (function ? function : "?")); zlog_abort(buff); } @@ -563,9 +562,8 @@ void _zlog_abort_err (const char *mess, int err, const char *file, unsigned int line, const char *function) { - const static size_t buff_size = 1024; - char buff[buff_size]; - snprintf(buff, buff_size, + char buff[1024]; + snprintf(buff, sizeof(buff), "%s, in file %s, line %u, function %s, %s", mess, file, line, (function ? function : "?"), errtoa(err, 0).str); |