From e43a18b091ec79667d261ebf2b461422ff0ee58f Mon Sep 17 00:00:00 2001 From: y-syo Date: Wed, 3 Sep 2025 17:07:03 +0200 Subject: [PATCH] =?UTF-8?q?=E3=80=8C=F0=9F=94=A8=E3=80=8D=20fix:=20fixed?= =?UTF-8?q?=20some=20things.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ex00/BitcoinExchange.cpp | 2 +- ex01/RPN.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ex00/BitcoinExchange.cpp b/ex00/BitcoinExchange.cpp index 5053d88..5132cb6 100644 --- a/ex00/BitcoinExchange.cpp +++ b/ex00/BitcoinExchange.cpp @@ -158,7 +158,7 @@ void BitcoinExchange::str(std::string filename) std::cout << "Error: bad input => " << line << std::endl; continue ; } - if (std::atol(value_str.c_str()) > 2147483647) + if (std::atol(value_str.c_str()) > 1000) { std::cout << "Error: too large a number." << std::endl; continue ; diff --git a/ex01/RPN.cpp b/ex01/RPN.cpp index ca35609..d1cd8c9 100644 --- a/ex01/RPN.cpp +++ b/ex01/RPN.cpp @@ -15,10 +15,10 @@ typedef int (*OperatorFunctions)(int, int); void rpn(char *av) { OperatorFunctions calc[128] = { NULL }; - calc['+'] = &add; - calc['-'] = &subst; - calc['*'] = &mult; - calc['/'] = ÷ + calc[(int) '+'] = &add; + calc[(int) '-'] = &subst; + calc[(int) '*'] = &mult; + calc[(int) '/'] = ÷ std::istringstream ss_input((std::string(av))); std::stack stack;