summaryrefslogtreecommitdiff
path: root/Source/Core/DiscIO
diff options
context:
space:
mode:
authorMaarten ter Huurne <maarten@treewalker.org>2008-09-18 09:30:23 +0000
committerMaarten ter Huurne <maarten@treewalker.org>2008-09-18 09:30:23 +0000
commitcbd945b137631c80e2dcc42b2f7230bff47fc062 (patch)
treeed265b27f82c85ecea9015b7732fbe7a004c0088 /Source/Core/DiscIO
parent0ba37abfdb93e248193c9a6434c9ba946c92868b (diff)
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
Diffstat (limited to 'Source/Core/DiscIO')
-rw-r--r--Source/Core/DiscIO/Src/VolumeGC.cpp14
1 files 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<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));
}