Changeset c1e11d32 in mainline


Ignore:
Timestamp:
2018-07-05T21:41:19Z (6 years ago)
Author:
Dzejrou <dzejrou@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d91b329
Parents:
7c84fce
git-author:
Dzejrou <dzejrou@…> (2017-12-18 12:25:48)
git-committer:
Dzejrou <dzejrou@…> (2018-07-05 21:41:19)
Message:

cpp: num_get now properly parses hexadecimal numbers

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/cpp/include/internal/locale/num_get.hpp

    r7c84fce rc1e11d32  
    329329                auto loc = base.getloc();
    330330                const auto& ct = use_facet<ctype<char_type>>(loc);
     331                auto hex = ((base.flags() & ios_base::hex) != 0);
    331332
    332333                size_t i{};
     
    337338                {
    338339                    auto c = *in;
    339                     if (ct.is(ctype_base::digit, c))
     340                    if (ct.is(ctype_base::digit, c) || (hex &&
     341                       ((c >= ct.widen('A') && c <= ct.widen('F')) ||
     342                        (c >= ct.widen('a') && c <= ct.widen('f')))))
    340343                    {
    341344                        ++in;
     
    345348                        break;
    346349                }
    347                 base.buffer_[i] = '\0';
     350                base.buffer_[i] = char_type{};
    348351
    349352                return i;
Note: See TracChangeset for help on using the changeset viewer.