Trying to fix MString assignments.

This commit is contained in:
Brad Arant committed 2023-10-10 15:49:46 -07:00
1 parent 74ab316e64
commit d020363bc9
12 files changed
+75 -16

No files matched your search

+13 -6
View File
@@ -81,13 +81,20 @@ namespace coreutils {
return *this;
}
MString &MString::operator=(coreutils::ZString value) {
setSize(value.getLength());
memcpy(data, value.getData(), value.getLength());
length = value.getLength();
return *this;
MString &MString::operator=(coreutils::ZString value) {
setSize(value.getLength());
memcpy(data, value.getData(), value.getLength());
length = value.getLength();
return *this;
}
MString &MString::operator=(std::string value) {
setSize(value.length());
memcpy(data, value.c_str(), value.length());
length = value.length();
return *this;
}
MString &MString::operator=(const char *value) {
int len = strlen(value);
setSize(len);