Skip to content

Commit

Permalink
Fixed setting of 'truncated'
Browse files Browse the repository at this point in the history
  • Loading branch information
jwellbelove committed Mar 17, 2019
1 parent 0db5da4 commit 92989fe
Show file tree
Hide file tree
Showing 9 changed files with 1,420 additions and 382 deletions.
6 changes: 4 additions & 2 deletions include/etl/basic_string.h
Original file line number Diff line number Diff line change
Expand Up @@ -794,8 +794,9 @@ namespace etl
const size_t start = std::distance(cbegin(), position);

// No effect.
if (start == CAPACITY)
if (start >= CAPACITY)
{
is_truncated = true;
return;
}

Expand Down Expand Up @@ -854,8 +855,9 @@ namespace etl
const size_t n = std::distance(first, last);

// No effect.
if (start == CAPACITY)
if (start >= CAPACITY)
{
is_truncated = true;
return;
}

Expand Down
10 changes: 10 additions & 0 deletions include/etl/string_view.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ SOFTWARE.
#include "char_traits.h"
#include "integral_limits.h"
#include "hash.h"
#include "basic_string.h"

#include "algorithm.h"

Expand Down Expand Up @@ -124,6 +125,15 @@ namespace etl
{
}

//*************************************************************************
/// Construct from string.
//*************************************************************************
ETL_CONSTEXPR basic_string_view(const etl::ibasic_string<T>& str)
: mbegin(str.begin()),
mend(str.end())
{
}

//*************************************************************************
/// Construct from T*.
//*************************************************************************
Expand Down
2 changes: 1 addition & 1 deletion include/etl/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ SOFTWARE.

#define ETL_VERSION_MAJOR 14
#define ETL_VERSION_MINOR 14
#define ETL_VERSION_PATCH 0
#define ETL_VERSION_PATCH 1

#define ETL_VERSION ETL_STRINGIFY(ETL_VERSION_MAJOR) ETL_STRINGIFY(ETL_VERSION_MINOR) ETL_STRINGIFY(ETL_VERSION_PATCH)
#define ETL_VERSION_W ETL_WIDE_STRING(ETL_CONCAT(ETL_CONCAT(ETL_VERSION_MAJOR, ETL_VERSION_MINOR), ETL_VERSION_PATCH))
Expand Down
4 changes: 4 additions & 0 deletions support/Release notes.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
===============================================================================
14.14.1
Fixed bug where 'truncated' was not always set correctly for strings.

===============================================================================
14.14.0
Fixed string push_back() bug where ther internal terminator was not updated.
Expand Down
Loading

0 comments on commit 92989fe

Please sign in to comment.