From cbd945b137631c80e2dcc42b2f7230bff47fc062 Mon Sep 17 00:00:00 2001 From: Maarten ter Huurne Date: Thu, 18 Sep 2008 09:30:23 +0000 Subject: [PATCH] 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 --- Source/Core/DiscIO/Src/VolumeGC.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Source/Core/DiscIO/Src/VolumeGC.cpp b/Source/Core/DiscIO/Src/VolumeGC.cpp index 1e337bed9b..3092f405c3 100644 --- a/Source/Core/DiscIO/Src/VolumeGC.cpp +++ b/Source/Core/DiscIO/Src/VolumeGC.cpp @@ -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(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)); }