     (save-excursion
       (set-buffer your-buffer)
       (erase-buffer)
-      (insert-buffer result-buffer)
+      (insert-buffer-substring result-buffer)
       (goto-char (point-min))
       (while (re-search-forward "^<<<<<<< .mine\n" nil t)
         (setq found t)

                  (ediff-cleanup-mess)
                  (set-buffer result)
                  (erase-buffer)
                  (insert-buffer buffer-C)
                  (kill-buffer buffer-A)
                  (kill-buffer buffer-B)
                  (kill-buffer buffer-C)

            (error "No conflict markers found")))
      (set-buffer other-buffer)
      (erase-buffer)
      (insert-buffer-substring result-buffer)
      (goto-char (point-min))
      (while (re-search-forward "^<<<<<<< .mine\n" nil t)
        (let ((start (match-beginning 0)))
