                  "-output-replacements-xml"
                  "-assume-filename" (or (buffer-file-name) "")
                  "-style" style
-                 "-offset" (number-to-string (1- start))
+                 "-offset" (number-to-string start)
                  "-length" (number-to-string (- end start))
-                 "-cursor" (number-to-string (1- (point)))))
+                 "-cursor" (number-to-string cursor)))
           (setq stderr
                 (with-temp-buffer
                   (insert-file-contents temp-file)

                      (apply #'clang-format--replace rpl))
                    replacements))
            (when cursor
              (goto-char cursor))))
      (delete-file temp-file)
      (when (buffer-name temp-buffer) (kill-buffer temp-buffer)))))


               (when (cdr children)
                 (error "More than one child node in <replacement> node"))

               (setq offset (string-to-number offset))
               (setq length (string-to-number length))
               (push (list offset length text) replacements)))
            ('cursor
             (setq cursor (string-to-number text)))))))

    ;; Sort by decreasing offset, length.
    (setq replacements (sort (delq nil replacements)
