Use unsigned type for integer digit

Fixes #109. Although we always used numbers in the ASCII range, it was
in a `size_t`, leading to a warning about possible loss of data on some
compilers.
This commit is contained in:
Jarryd Beck 2018-05-07 18:54:42 +10:00
parent d47101a101
commit e725ea3084
2 changed files with 5 additions and 1 deletions

View File

@ -9,6 +9,10 @@ options. The project adheres to semantic versioning.
* Allow integers to have leading zeroes.
### Bug Fixes
* Fix a warning about possible loss of data.
## 2.1.1
### Bug Fixes

View File

@ -547,7 +547,7 @@ namespace cxxopts
for (auto iter = value_match.first; iter != value_match.second; ++iter)
{
size_t digit = 0;
US digit = 0;
if (*iter >= '0' && *iter <= '9')
{