From 76719bac45032dfc3b31f133cb9dbf011b201078 Mon Sep 17 00:00:00 2001 From: Soren Jorvang Date: Sun, 30 Jan 2011 17:58:02 +0000 Subject: [PATCH] Terminate a C string. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6990 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/DiscIO/Src/VolumeGC.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Source/Core/DiscIO/Src/VolumeGC.cpp b/Source/Core/DiscIO/Src/VolumeGC.cpp index 510d8d1156..0b0fabf7e9 100644 --- a/Source/Core/DiscIO/Src/VolumeGC.cpp +++ b/Source/Core/DiscIO/Src/VolumeGC.cpp @@ -54,14 +54,17 @@ std::string CVolumeGC::GetUniqueID() const if (m_pReader == NULL) return NO_UID; - char id[6]; - if (!Read(0, sizeof(id), reinterpret_cast(id))) + char ID[7]; + + if (!Read(0, sizeof(ID), reinterpret_cast(ID))) { PanicAlertT("Failed to read unique ID from disc image"); return NO_UID; } - return std::string(id, sizeof(id)); + ID[6] = '\0'; + + return ID; } IVolume::ECountry CVolumeGC::GetCountry() const