Skip to content

Commit

Permalink
updates...
Browse files Browse the repository at this point in the history
  • Loading branch information
cokkeijigen committed Mar 9, 2023
1 parent fd8ae5f commit 25591c4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 1 addition & 2 deletions MesRepacker/MesHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,8 @@ class MesRepacker : public MesHelper {
tmp = new byte[len];
*tmp = (*iter).key;
memcpy(tmp + 1, text.c_str(), strlen(text.c_str()) + 1);
if (this->conf->decstr.with((*iter).key)) {
if (this->conf->decstr.with((*iter).key))
for (int i = 1; i < len - 1; i++) tmp[i] -= 0x20;
}
this->writeBuffer->write(tmp, len);
delete[] tmp;
}
Expand Down
6 changes: 4 additions & 2 deletions MesRepacker/WriteBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,23 @@
class WriteBuffer {
byte* buffer;
size_t raise;
long size, len;
long initial, size, len;

public:
WriteBuffer() : WriteBuffer(1024, 500) {}

WriteBuffer(size_t initial, size_t raise) {
this->buffer = new byte[initial];
this->initial = initial;
this->size = initial;
this->raise = raise;
this->len = 0;
}

void reset() {
if (this->buffer) delete[] this->buffer;
this->buffer = new byte[this->size];
this->buffer = new byte[this->initial];
this->size = this->initial;
this->len = 0;
}

Expand Down

0 comments on commit 25591c4

Please sign in to comment.