From 41c4dccf481fe6bed1a3b04e77141ba62cc1f5e6 Mon Sep 17 00:00:00 2001 From: Joseph Schuchart Date: Sat, 11 Sep 2021 15:43:07 -0400 Subject: [PATCH] Use stol to avoid out-of-range exceptions Signed-off-by: Joseph Schuchart --- examples/spmm/spmm.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/spmm/spmm.cc b/examples/spmm/spmm.cc index ef5f5d5706..f5e9bdf374 100644 --- a/examples/spmm/spmm.cc +++ b/examples/spmm/spmm.cc @@ -627,7 +627,7 @@ static int parseOption(std::string &option, int default_value) { pos = option.length(); } token = option.substr(0, pos); - N = std::stoi(token); + N = std::stol(token); option.erase(0, pos + 1); return N; }