Browse Source

Fixed bug in String_Type::replace().

Added static_cast in Socket::accept() (disable warning).
release/0.19
JustinAJ 10 years ago
parent
commit
58f5ca6d84
  1. 2
      Jupiter/Socket.cpp
  2. 17
      Jupiter/String_Type_Imp.h
  3. BIN
      Release/Jupiter.lib

2
Jupiter/Socket.cpp

@ -367,7 +367,7 @@ Jupiter::Socket *Jupiter::Socket::accept()
r->data_->sockType = Jupiter::Socket::data_->sockType; r->data_->sockType = Jupiter::Socket::data_->sockType;
r->data_->sockProto = Jupiter::Socket::data_->sockProto; r->data_->sockProto = Jupiter::Socket::data_->sockProto;
r->data_->host.set(resolved); r->data_->host.set(resolved);
r->data_->port = Jupiter_strtoi(resolved_port, 10); r->data_->port = static_cast<unsigned short>(Jupiter_strtoi(resolved_port, 10));
return r; return r;
} }
return nullptr; return nullptr;

17
Jupiter/String_Type_Imp.h

@ -521,16 +521,19 @@ template<typename T> size_t Jupiter::String_Type<T>::replace(size_t index, size_
} }
else else
{ {
this->setBufferSize(Jupiter::String_Type<T>::length + valueSize - targetSize);
Jupiter::String_Type<T>::length += valueSize - targetSize;
size_t i = Jupiter::String_Type<T>::length; size_t i = Jupiter::String_Type<T>::length;
while (--i != index + targetSize + 1) valueSize -= targetSize;
Jupiter::String_Type<T>::str[i] = Jupiter::String_Type<T>::str[i - valueSize + targetSize]; this->setBufferSize(Jupiter::String_Type<T>::length + valueSize);
this->println(stdout); Jupiter::String_Type<T>::length += valueSize;
index += targetSize;
while (i-- != index)
Jupiter::String_Type<T>::str[i + valueSize] = Jupiter::String_Type<T>::str[i];
index -= targetSize;
valueSize += targetSize;
Jupiter::String_Type<T>::str[index] = *value; Jupiter::String_Type<T>::str[index] = *value;
while (index != i) while (--valueSize != 0)
Jupiter::String_Type<T>::str[++index] = *++value; Jupiter::String_Type<T>::str[++index] = *++value;
} }
} }

BIN
Release/Jupiter.lib

Binary file not shown.
Loading…
Cancel
Save