mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-14 00:09:24 +01:00
Fixed error handling in GetUniqueID(): returning "false" is not an option if your return type is std::string...
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@575 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
0ba37abfdb
commit
cbd945b137
@ -67,21 +67,21 @@ CVolumeGC::GetName() const
|
|||||||
std::string
|
std::string
|
||||||
CVolumeGC::GetUniqueID() const
|
CVolumeGC::GetUniqueID() const
|
||||||
{
|
{
|
||||||
|
static const std::string NO_UID("NO_UID");
|
||||||
if (m_pReader == NULL)
|
if (m_pReader == NULL)
|
||||||
{
|
{
|
||||||
return(false);
|
return NO_UID;
|
||||||
}
|
}
|
||||||
|
|
||||||
char ID[7];
|
char id[6];
|
||||||
|
|
||||||
if (!Read(0, 6, (u8*)ID))
|
if (!Read(0, sizeof(id), reinterpret_cast<u8*>(id)))
|
||||||
{
|
{
|
||||||
return(false);
|
PanicAlert("Failed to read unique ID from disc image");
|
||||||
|
return NO_UID;
|
||||||
}
|
}
|
||||||
|
|
||||||
ID[6] = 0;
|
return std::string(id, sizeof(id));
|
||||||
|
|
||||||
return(ID);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user