diff options
author | Johannes Schickel | 2009-10-28 20:24:55 +0000 |
---|---|---|
committer | Johannes Schickel | 2009-10-28 20:24:55 +0000 |
commit | 3263191c264b798ac1d91fd7ec41895862eb72b6 (patch) | |
tree | 93d1af435a1b4eba4cae37487a6ec5383caf3e82 | |
parent | 142d2e73c02851783d5fc1c4836477d93612e595 (diff) | |
download | scummvm-rg350-3263191c264b798ac1d91fd7ec41895862eb72b6.tar.gz scummvm-rg350-3263191c264b798ac1d91fd7ec41895862eb72b6.tar.bz2 scummvm-rg350-3263191c264b798ac1d91fd7ec41895862eb72b6.zip |
Fix bug createUUID, which caused our custom createUUID implementation to fail to convert some UUIDs to a string correctly.
svn-id: r45482
-rw-r--r-- | tools/create_msvc/create_msvc.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/create_msvc/create_msvc.cpp b/tools/create_msvc/create_msvc.cpp index 51d0afe683..4ac6e3d615 100644 --- a/tools/create_msvc/create_msvc.cpp +++ b/tools/create_msvc/create_msvc.cpp @@ -727,17 +727,17 @@ std::string createUUID() { unsigned char uuid[16]; for (int i = 0; i < 16; ++i) - uuid[i] = (std::rand() / (double)(RAND_MAX)) * 0xFF; + uuid[i] = (unsigned char)((std::rand() / (double)(RAND_MAX)) * 0xFF); uuid[8] &= 0xBF; uuid[8] |= 0x80; uuid[6] &= 0x4F; uuid[6] |= 0x40; std::stringstream uuidString; - uuidString << std::hex << std::uppercase << std::setw(2) << std::setfill('0'); + uuidString << std::hex << std::uppercase << std::setfill('0'); for (int i = 0; i < 16; ++i) { - uuidString << (int)uuid[i]; + uuidString << std::setw(2) << (int)uuid[i]; if (i == 3 || i == 5 || i == 7 || i == 9) { - uuidString << std::setw(0) << '-' << std::setw(2); + uuidString << std::setw(0) << '-'; } } |