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 ECF8422BB6 for ; Mon, 1 Jul 2019 17:52:02 -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 bcHgZpH0u8WL for ; Mon, 1 Jul 2019 17:52:02 -0400 (EDT) Received: from smtp10.mail.ru (smtp10.mail.ru [94.100.181.92]) (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 5AB7D22B80 for ; Mon, 1 Jul 2019 17:52:02 -0400 (EDT) Subject: [tarantool-patches] Re: [PATCH 1/6] sql: refactor sql_atoi64() References: <15f86ff05673055364c6a6bd11de4568e4c3854f.1559919361.git.korablev@tarantool.org> <0ae708be-9670-e726-b7ea-9faec8c007ea@tarantool.org> <9898E449-3735-4744-83A9-47B1DC64A72C@tarantool.org> From: Vladislav Shpilevoy Message-ID: <32c57e1b-41b6-81f3-b3f0-176e50263a94@tarantool.org> Date: Mon, 1 Jul 2019 23:53:00 +0200 MIME-Version: 1.0 In-Reply-To: <9898E449-3735-4744-83A9-47B1DC64A72C@tarantool.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit 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: "n.pettik" , tarantool-patches@freelists.org Hi! Thanks for the fixes! Consider new ones below, and on the branch in a separate commit. ===================================================== diff --git a/src/box/sql/expr.c b/src/box/sql/expr.c index 0df050e7a..bf347b401 100644 --- a/src/box/sql/expr.c +++ b/src/box/sql/expr.c @@ -3292,11 +3292,10 @@ expr_code_int(struct Parse *parse, struct Expr *expr, bool is_neg, const char *sign = is_neg ? "-" : ""; if (z[0] == '0' && (z[1] == 'x' || z[1] == 'X')) { errno = 0; - char *end = NULL; if (is_neg) { - value = strtoll(z, &end, 16); + value = strtoll(z, NULL, 16); } else { - value = strtoull(z, &end, 16); + value = strtoull(z, NULL, 16); if (value > INT64_MAX) goto int_overflow; }