From ea8e8f36c83ba4a2f7df392d9e6da7b6c9721b72 Mon Sep 17 00:00:00 2001 From: "techdragon.nguyen@gmail.com" Date: Wed, 23 Feb 2011 18:30:45 +0000 Subject: [PATCH] fixed very obscure bug. In VS2010 the string was being trimmed before going into Construct method, but the string length was not updated. Thus, Construct thought the string length was 1 greater than it should have been causing an out of bounds runtime exception. In VS2008, the same thing happened, however no exception was thrown since VS2008 allows access into the undefined memory space and returned a 0 (null) value when it tried to access outside the string array. This fix targets specifically the color filters since they seem to be the ones with the error. " color:g;" and not "color:g;" was being passed. --- projects/mtg/src/MTGPack.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/mtg/src/MTGPack.cpp b/projects/mtg/src/MTGPack.cpp index 5b15c0c07..7b1a91a32 100644 --- a/projects/mtg/src/MTGPack.cpp +++ b/projects/mtg/src/MTGPack.cpp @@ -71,7 +71,7 @@ WSrcCards * MTGPack::getPool(string poolstr) s = poolstr.find("unlocked"); string sub = poolstr; if (s != string::npos) - sub = poolstr.substr(s + 8); + sub = trim(poolstr.substr(s + 8)); if (sub.size()) { mySrc->addFilter(ff->Construct(sub));