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:
Maarten ter Huurne 2008-09-18 09:30:23 +00:00
parent 0ba37abfdb
commit cbd945b137
1 changed files with 7 additions and 7 deletions

View File

@ -67,21 +67,21 @@ CVolumeGC::GetName() const
std::string
CVolumeGC::GetUniqueID() const
{
static const std::string NO_UID("NO_UID");
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(ID);
return std::string(id, sizeof(id));
}