From 3593a823ca0dd92bbe58aa3464d8a371f6f35e70 Mon Sep 17 00:00:00 2001 From: Chris Hall Date: Fri, 2 Sep 2011 12:07:01 +0100 Subject: Changed gcc options to -std=c99 and -O2, and tighted warnings. Some small changes to accomodate same. --- lib/log.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'lib/log.c') diff --git a/lib/log.c b/lib/log.c index d4feb75c..610d4af1 100644 --- a/lib/log.c +++ b/lib/log.c @@ -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); -- cgit v1.2.3