mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-03-12 01:41:37 +00:00
Don't bother clearing the Magic string when the magic number
can't be read, since it isn't cleared on other error paths. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104852 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
130de9c0b4
commit
02d5824266
@ -421,10 +421,8 @@ bool Path::getMagicNumber(std::string &Magic, unsigned len) const {
|
||||
return false;
|
||||
ssize_t bytes_read = ::read(fd, Buf, len);
|
||||
::close(fd);
|
||||
if (ssize_t(len) != bytes_read) {
|
||||
Magic.clear();
|
||||
if (ssize_t(len) != bytes_read)
|
||||
return false;
|
||||
}
|
||||
Magic.assign(Buf, len);
|
||||
return true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user