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:
bed3d11
Parents:
2e0256b
git-author:
Dzejrou <dzejrou@…> (2017-12-17 14:57:48)
git-committer:
Dzejrou <dzejrou@…> (2018-07-05 21:41:19)
Message:

cpp: fixed the stdin stream buffer

File:
1 edited

Legend:

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

    r2e0256b rf5a77a00  
    8282                    auto c = fgetc(in_);
    8383                    putchar(c); // TODO: Temporary source of feedback.
    84                     auto ic = traits_type::to_int_type(c);
    85                     if (traits_type::eq_int_type(ic, traits_type::eof()))
     84                    if (c == traits_type::eof())
    8685                        break;
    8786
    88                     buffer_[i] = c;
     87                    buffer_[i] = static_cast<char_type>(c);
    8988
    90                     if (c == '\n')
     89                    if (buffer_[i] == '\n')
     90                    {
     91                        ++i;
    9192                        break;
     93                    }
    9294                }
    9395
     
    103105            int_type uflow() override
    104106            {
    105                 // TODO: what is the difference between uflow and underflow?
    106107                auto res = underflow();
    107                 ++*input_next_;
     108                ++input_next_;
    108109
    109110                return res;
Note: See TracChangeset for help on using the changeset viewer.