Fix a bug in previous checkin
authorChris Lattner <sabre@nondot.org>
Sun, 23 Jan 2005 03:19:13 +0000 (03:19 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 23 Jan 2005 03:19:13 +0000 (03:19 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19769 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Support/FileUtilities.cpp

index 79cca8fda1dc9ab07acd423d160b4f37ee5145c6..8ce9602872a8790b8aefbab8496026e9f9a76794 100644 (file)
@@ -239,9 +239,9 @@ int llvm::DiffFilesWithTolerance(const std::string &FileA,
     }
 
     if (OrigFile1Start != File1Start)
-      delete[] File1Start;
+      delete[] File1Start-1;   // Back up past null byte
     if (OrigFile2Start != File2Start)
-      delete[] File2Start;
+      delete[] File2Start-1;   // Back up past null byte
     return CompareFailed;
   } catch (const std::string &Msg) {
     if (Error) *Error = Msg;