diff --git a/Jupiter/CString_Imp.h b/Jupiter/CString_Imp.h index ce616e6..4dce368 100644 --- a/Jupiter/CString_Imp.h +++ b/Jupiter/CString_Imp.h @@ -292,16 +292,18 @@ template Jupiter::CString_Type Jupiter::CString_Type::gotoWord template size_t Jupiter::CString_Type::set(const Jupiter::Readable_String &in) { this->setBufferSizeNoCopy(in.size()); - for (Jupiter::String_Type::length = 0; Jupiter::String_Type::length < in.size() && in.get(Jupiter::String_Type::length) != 0; Jupiter::String_Type::length++) + for (Jupiter::String_Type::length = 0; Jupiter::String_Type::length != in.size() && in.get(Jupiter::String_Type::length) != 0; Jupiter::String_Type::length++) Jupiter::String_Type::str[Jupiter::String_Type::length] = in.get(Jupiter::String_Type::length); + Jupiter::String_Type::str[Jupiter::String_Type::length] = 0; return Jupiter::String_Type::length; } template size_t Jupiter::CString_Type::set(const std::basic_string &in) { this->setBufferSizeNoCopy(in.size()); - for (Jupiter::String_Type::length = 0; Jupiter::String_Type::length < in.size() && in.at(Jupiter::String_Type::length) != 0; Jupiter::String_Type::length++) + for (Jupiter::String_Type::length = 0; Jupiter::String_Type::length != in.size() && in.at(Jupiter::String_Type::length) != 0; Jupiter::String_Type::length++) Jupiter::String_Type::str[Jupiter::String_Type::length] = in.at(Jupiter::String_Type::length); + Jupiter::String_Type::str[Jupiter::String_Type::length] return Jupiter::String_Type::length; }