summaryrefslogtreecommitdiffstats
path: root/Source/cmFileCommand.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmFileCommand.cxx')
-rw-r--r--Source/cmFileCommand.cxx10
1 files changed, 8 insertions, 2 deletions
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index da2f15f..fb15a1b 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -199,13 +199,19 @@ bool HandleReadCommand(std::vector<std::string> const& args,
// is there a limit?
std::string::size_type sizeLimit = std::string::npos;
if (!arguments.Limit.empty()) {
- std::istringstream(arguments.Limit) >> sizeLimit;
+ unsigned long long limit;
+ if (cmStrToULongLong(arguments.Limit, &limit)) {
+ sizeLimit = static_cast<std::string::size_type>(limit);
+ }
}
// is there an offset?
cmsys::ifstream::off_type offset = 0;
if (!arguments.Offset.empty()) {
- std::istringstream(arguments.Offset) >> offset;
+ long long off;
+ if (cmStrToLongLong(arguments.Offset, &off)) {
+ offset = static_cast<cmsys::ifstream::off_type>(off);
+ }
}
file.seekg(offset, std::ios::beg); // explicit ios::beg for IBM VisualAge 6