summaryrefslogtreecommitdiff
path: root/src/T2DLL/T2Archive.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/T2DLL/T2Archive.cpp40
1 files changed, 20 insertions, 20 deletions
diff --git a/src/T2DLL/T2Archive.cpp b/src/T2DLL/T2Archive.cpp
index 8aac959..2431a27 100644
--- a/src/T2DLL/T2Archive.cpp
+++ b/src/T2DLL/T2Archive.cpp
@@ -238,22 +238,22 @@ BOOL T2Archive::operator<<(RECT v) {
}
BOOL T2Archive::operator>>(CString& v) {
- int maxSize = 16;
+ int maxLen = 16;
char buf[17];
v = "";
- int sz = Read(buf, maxSize);
- while (strlen(buf) == sz) {
- buf[sz] = 0;
+ int amountRead = Read(buf, maxLen);
+ while (strlen(buf) == amountRead) {
+ buf[amountRead] = 0;
v += buf;
- if (sz < maxSize)
+ if (amountRead < maxLen)
return false;
- sz = Read(buf, maxSize);
+ amountRead = Read(buf, maxLen);
}
int len = strlen(buf);
- mFile->Seek(len - sz + 1, CFile::current);
+ mFile->Seek(len - amountRead + 1, CFile::current);
v += buf;
return true;
@@ -267,22 +267,22 @@ BOOL T2Archive::operator<<(CString& v) {
}
BOOL T2Archive::operator>>(char* v) {
- int maxSize = 16;
+ int maxLen = 16;
char buf[17];
v = ""; // BUG!!
- int sz = Read(buf, maxSize);
- while (strlen(buf) == sz) {
- buf[sz] = 0;
+ int amountRead = Read(buf, maxLen);
+ while (strlen(buf) == amountRead) {
+ buf[amountRead] = 0;
strcat(v, buf);
- if (sz < maxSize)
+ if (amountRead < maxLen)
return false;
- sz = Read(buf, maxSize);
+ amountRead = Read(buf, maxLen);
}
int len = strlen(buf);
- mFile->Seek(len - sz + 1, CFile::current);
+ mFile->Seek(len - amountRead + 1, CFile::current);
strcat(v, buf);
return true;
@@ -329,20 +329,20 @@ BOOL T2Archive::WritePStr(const char* v) {
}
/*virtual*/ BOOL T2Archive::Skip(unsigned long v) {
- int size;
+ int bufSize;
BOOL result = true;
if (v > 1000)
- size = 1000;
+ bufSize = 1000;
else
- size = v;
+ bufSize = v;
- void *buf = malloc(size);
+ void *buf = malloc(bufSize);
while (v > 0) {
- int howMuch = Read(buf, size);
+ int howMuch = Read(buf, bufSize);
v -= howMuch;
- if (howMuch < size && v > 0) {
+ if (howMuch < bufSize && v > 0) {
result = false;
break;
}