From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 89CE227232 for ; Wed, 18 Jul 2018 10:26:27 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xgvVKpOcYuIu for ; Wed, 18 Jul 2018 10:26:27 -0400 (EDT) Received: from smtpng2.m.smailru.net (smtpng2.m.smailru.net [94.100.179.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id C208927161 for ; Wed, 18 Jul 2018 10:26:26 -0400 (EDT) From: Kirill Shcherbatov Subject: [tarantool-patches] [PATCH v1 1/1] say: fix invalid arguments Date: Wed, 18 Jul 2018 17:26:22 +0300 Message-Id: <8d5df1d2ee0c00af6d40673cd9aca30f3d4d6690.1531923866.git.kshcherbatov@tarantool.org> Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-subscribe: List-owner: List-post: List-archive: To: tarantool-patches@freelists.org Cc: v.shpilevoy@tarantool.org, Kirill Shcherbatov _say function was called with invalid arguments. Thank @sorc1 for patch. Closes #3433. --- Branch: http://github.com/tarantool/tarantool/tree/kshch/gh-3433-c-say-fix Issue: https://github.com/tarantool/tarantool/issues/3433 src/say.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/say.h b/src/say.h index f324c27..708637c 100644 --- a/src/say.h +++ b/src/say.h @@ -261,26 +261,28 @@ CFORMAT(printf, 5, 0) extern sayfunc_t _say; * \param level (int) - log level (see enum \link say_level \endlink) * \param file (const char * ) - file name to print * \param line (int) - line number to print + * \param error (const char * ) - error description, may be NULL * \param format (const char * ) - printf()-like format string * \param ... - format arguments * \sa printf() * \sa enum say_level */ -#define say_file_line(level, file, line, format, ...) ({ \ +#define say_file_line(level, file, line, error, format, ...) ({ \ if (say_log_level_is_enabled(level)) \ - _say(level, file, line, format, ##__VA_ARGS__); }) + _say(level, file, line, error, format, ##__VA_ARGS__); }) /** * Format and print a message to Tarantool log file. * * \param level (int) - log level (see enum \link say_level \endlink) + * \param error (const char * ) - error description, may be NULL * \param format (const char * ) - printf()-like format string * \param ... - format arguments * \sa printf() * \sa enum say_level */ -#define say(level, format, ...) ({ \ - say_file_line(level, __FILE__, __LINE__, format, ##__VA_ARGS__); }) +#define say(level, error, format, ...) ({ \ + say_file_line(level, __FILE__, __LINE__, error, format, ##__VA_ARGS__); }) /** * Format and print a message to Tarantool log file. -- 2.7.4