From 10991e00a9437d8edfbd06872a043fc36b93d5fd Mon Sep 17 00:00:00 2001 From: xjqbest <173596896@qq.com> Date: Tue, 16 Apr 2019 15:36:39 +0800 Subject: [PATCH] fix bug of num > INT_MAX --- paddle/fluid/framework/data_feed.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paddle/fluid/framework/data_feed.cc b/paddle/fluid/framework/data_feed.cc index 7529b7578e..0291b6f66a 100644 --- a/paddle/fluid/framework/data_feed.cc +++ b/paddle/fluid/framework/data_feed.cc @@ -531,7 +531,7 @@ bool MultiSlotDataFeed::CheckFile(const char* filename) { char* endptr = const_cast(str); int len = line.length(); for (size_t i = 0; i < all_slots_.size(); ++i) { - long num = strtol(endptr, &endptr, 10); + auto num = strtol(endptr, &endptr, 10); if (num < 0) { VLOG(0) << "error: the number of ids is a negative number: " << num; VLOG(0) << "please check line<" << instance_cout << "> in file<" -- GitLab