mirror of https://github.com/libAthena/athena.git
fixed length string read refinement
This commit is contained in:
parent
2d8aeb70e8
commit
687a7eef64
2
PKGBUILD
2
PKGBUILD
|
@ -1,7 +1,7 @@
|
||||||
# PKGBUILD for libAthena
|
# PKGBUILD for libAthena
|
||||||
_pkgname=libathena
|
_pkgname=libathena
|
||||||
pkgname=$_pkgname-git
|
pkgname=$_pkgname-git
|
||||||
pkgver=1.1.0.37.g3dfb001
|
pkgver=1.1.0.39.g2d8aeb7
|
||||||
pkgrel=1
|
pkgrel=1
|
||||||
pkgdesc="Basic cross platform IO library"
|
pkgdesc="Basic cross platform IO library"
|
||||||
arch=('i686' 'x86_64')
|
arch=('i686' 'x86_64')
|
||||||
|
|
|
@ -346,12 +346,13 @@ std::string FileReader::readString(atInt32 fixedLen)
|
||||||
|
|
||||||
atUint8 chr = readByte();
|
atUint8 chr = readByte();
|
||||||
atInt32 i;
|
atInt32 i;
|
||||||
for (i = 0 ; chr != 0 ; ++i)
|
for (i = 1 ; chr != 0 ; ++i)
|
||||||
{
|
{
|
||||||
if (fixedLen >= 0 && i >= fixedLen - 1)
|
ret += chr;
|
||||||
|
|
||||||
|
if (fixedLen >= 0 && i >= fixedLen)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
ret += chr;
|
|
||||||
chr = readByte();
|
chr = readByte();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -367,12 +368,13 @@ std::wstring FileReader::readWString(atInt32 fixedLen)
|
||||||
atUint16 chr = readUint16();
|
atUint16 chr = readUint16();
|
||||||
|
|
||||||
atInt32 i;
|
atInt32 i;
|
||||||
for (i = 0 ; chr != 0 ; ++i)
|
for (i = 1 ; chr != 0 ; ++i)
|
||||||
{
|
{
|
||||||
if (fixedLen >= 0 && i >= fixedLen - 1)
|
ret += chr;
|
||||||
|
|
||||||
|
if (fixedLen >= 0 && i >= fixedLen)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
ret += chr;
|
|
||||||
chr = readUint16();
|
chr = readUint16();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -528,12 +528,13 @@ std::string MemoryReader::readString(atInt32 fixedLen)
|
||||||
atUint8 chr = readByte();
|
atUint8 chr = readByte();
|
||||||
|
|
||||||
atInt32 i;
|
atInt32 i;
|
||||||
for (i = 0 ; chr != 0 ; ++i)
|
for (i = 1 ; chr != 0 ; ++i)
|
||||||
{
|
{
|
||||||
if (fixedLen >= 0 && i >= fixedLen - 1)
|
ret += chr;
|
||||||
|
|
||||||
|
if (fixedLen >= 0 && i >= fixedLen)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
ret += chr;
|
|
||||||
chr = readByte();
|
chr = readByte();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -549,12 +550,13 @@ std::wstring MemoryReader::readWString(atInt32 fixedLen)
|
||||||
atUint16 chr = readUint16();
|
atUint16 chr = readUint16();
|
||||||
|
|
||||||
atInt32 i;
|
atInt32 i;
|
||||||
for (i = 0 ; chr != 0 ; ++i)
|
for (i = 1 ; chr != 0 ; ++i)
|
||||||
{
|
{
|
||||||
if (fixedLen >= 0 && i >= fixedLen - 1)
|
ret += chr;
|
||||||
|
|
||||||
|
if (fixedLen >= 0 && i >= fixedLen)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
ret += chr;
|
|
||||||
chr = readUint16();
|
chr = readUint16();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue