mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-08-23 06:13:07 -06:00
Core: LoadStream error handling refactored #660
git-svn-id: svn://ultimatepp.org/upp/trunk@6814 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
44f0710987
commit
decbc87410
1 changed files with 6 additions and 5 deletions
|
|
@ -1531,12 +1531,13 @@ String ReadStdIn()
|
|||
String LoadStream(Stream& in) {
|
||||
if(in.IsOpen()) {
|
||||
in.ClearError();
|
||||
int size = (int)in.GetLeft();
|
||||
StringBuffer s(size);
|
||||
if((dword)size != 0xffffffff)
|
||||
int64 size = in.GetLeft();
|
||||
if(size >= 0 && size < INT_MAX / 2) {
|
||||
StringBuffer s((int)size);
|
||||
in.Get(s, size);
|
||||
if(!in.IsError())
|
||||
return s;
|
||||
if(!in.IsError())
|
||||
return s;
|
||||
}
|
||||
}
|
||||
return String::GetVoid();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue