diff --git a/bridge/foundation/string_builder.h b/bridge/foundation/string_builder.h index 4a5e7a1ca..5a6b27544 100644 --- a/bridge/foundation/string_builder.h +++ b/bridge/foundation/string_builder.h @@ -6,16 +6,18 @@ #ifndef WEBF_FOUNDATION_STRING_BUILDER_H_ #define WEBF_FOUNDATION_STRING_BUILDER_H_ -#include #include -#include -#include +#include #include +#include +#include #include #include "foundation/dtoa.h" #include "foundation/macros.h" #include "foundation/string_view.h" +#include + namespace webf { /** @@ -99,13 +101,13 @@ class StringBuilder { // a Text node. const char* impl = view.data(); if (!length_ && !HasBuffer() && impl != nullptr) { - string_ = impl; + string_ = std::string(impl, view.length()); length_ = view.length(); return; } EnsureBuffer8(view.length()); - string_.append(view); + string_.append(std::string(view.data(), view.length())); length_ += view.length(); }