diff --git a/pre_commit_hooks/file_contents_sorter.py b/pre_commit_hooks/file_contents_sorter.py
index c5691f0..02bdbcc 100644
--- a/pre_commit_hooks/file_contents_sorter.py
+++ b/pre_commit_hooks/file_contents_sorter.py
@@ -37,7 +37,10 @@ def sort_file_contents(
     after = sorted(lines, key=key)
 
     before_string = b''.join(before)
-    after_string = b'\n'.join(after) + b'\n'
+    after_string = b'\n'.join(after)
+
+    if after_string:
+        after_string += b'\n'
 
     if before_string == after_string:
         return PASS

diff --git a/tests/file_contents_sorter_test.py b/tests/file_contents_sorter_test.py
index 5e79e40..49b3b79 100644
--- a/tests/file_contents_sorter_test.py
+++ b/tests/file_contents_sorter_test.py
@@ -10,7 +10,9 @@ from pre_commit_hooks.file_contents_sorter import PASS
 @pytest.mark.parametrize(
     ('input_s', 'argv', 'expected_retval', 'output'),
     (
-        (b'', [], FAIL, b'\n'),
+        (b'', [], PASS, b''),
+        (b'\n', [], FAIL, b''),
+        (b'\n\n', [], FAIL, b''),
         (b'lonesome\n', [], PASS, b'lonesome\n'),
         (b'missing_newline', [], FAIL, b'missing_newline\n'),
         (b'newline\nmissing', [], FAIL, b'missing\nnewline\n'),

`file-contents-sorter` adds an extra blank line if the file to be sorted is empty
I am on `v.4.4.0`, Python `3.11.4`, macOS Ventura `13.4.1`.

My `.pre-commit-config.yaml`:

```yaml
repos:
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: "v4.4.0"
    hooks:
      - id: end-of-file-fixer
      - id: file-contents-sorter
        files: ^requirements\/.+\.in$
        # args: [--unique, --ignore-case]
```

The files are intentionally **empty** &ndash; I'm in the planning stage, they are just placeholders for requriements[^1].

To the point: `file-contents-sorter` adds an extra blank to them, what results in a confict with `end-of-file-fixer`. I am not sure if that is the expected behavior... Updating `args` doesn't have any effect.

```bash
$ git:(install-and-configure-pre-commit) : pre-commit run --all-files
fix end of files.........................................................Failed
- hook id: end-of-file-fixer
- exit code: 1
- files were modified by this hook

Fixing requirements/build.in
Fixing requirements/lint.in
Fixing requirements/test.in

file contents sorter.....................................................Failed
- hook id: file-contents-sorter
- exit code: 1
- files were modified by this hook

Sorting requirements/build.in
Sorting requirements/lint.in
Sorting requirements/test.in
```

[^1]: Yes, I know that I can use `requirements-txt-fixer` particularly for requirements. 😄 I will do. For that issue it doesn't matter.
tests/file_contents_sorter_test.py::test_integration[-argv0-0-] tests/file_contents_sorter_test.py::test_integration[\n-argv1-1-] tests/file_contents_sorter_test.py::test_integration[\n\n-argv2-1-]
tests/file_contents_sorter_test.py::test_integration[lonesome\n-argv3-0-lonesome\n] tests/file_contents_sorter_test.py::test_integration[missing_newline-argv4-1-missing_newline\n] tests/file_contents_sorter_test.py::test_integration[newline\nmissing-argv5-1-missing\nnewline\n] tests/file_contents_sorter_test.py::test_integration[missing\nnewline-argv6-1-missing\nnewline\n] tests/file_contents_sorter_test.py::test_integration[alpha\nbeta\n-argv7-0-alpha\nbeta\n] tests/file_contents_sorter_test.py::test_integration[beta\nalpha\n-argv8-1-alpha\nbeta\n] tests/file_contents_sorter_test.py::test_integration[C\nc\n-argv9-0-C\nc\n] tests/file_contents_sorter_test.py::test_integration[c\nC\n-argv10-1-C\nc\n] tests/file_contents_sorter_test.py::test_integration[mag tests/file_contents_sorter_test.py::test_integration[@\n-\n_\n#\n-argv12-1-#\n-\n@\n_\n] tests/file_contents_sorter_test.py::test_integration[extra\n\n\nwhitespace\n-argv13-1-extra\nwhitespace\n] tests/file_contents_sorter_test.py::test_integration[whitespace\n\n\nextra\n-argv14-1-extra\nwhitespace\n] tests/file_contents_sorter_test.py::test_integration[fee\nFie\nFoe\nfum\n-argv15-1-Fie\nFoe\nfee\nfum\n] tests/file_contents_sorter_test.py::test_integration[Fie\nFoe\nfee\nfum\n-argv16-0-Fie\nFoe\nfee\nfum\n] tests/file_contents_sorter_test.py::test_integration[fee\nFie\nFoe\nfum\n-argv17-0-fee\nFie\nFoe\nfum\n] tests/file_contents_sorter_test.py::test_integration[Fie\nFoe\nfee\nfum\n-argv18-1-fee\nFie\nFoe\nfum\n] tests/file_contents_sorter_test.py::test_integration[Fie\nFoe\nfee\nfee\nfum\n-argv19-1-fee\nfee\nFie\nFoe\nfum\n] tests/file_contents_sorter_test.py::test_integration[Fie\nFoe\nfee\nfum\n-argv20-0-Fie\nFoe\nfee\nfum\n] tests/file_contents_sorter_test.py::test_integration[Fie\nFie\nFoe\nfee\nfum\n-argv21-1-Fie\nFoe\nfee\nfum\n] tests/file_contents_sorter_test.py::test_integration[fee\nFie\nFoe\nfum\n-argv22-0-fee\nFie\nFoe\nfum\n] tests/file_contents_sorter_test.py::test_integration[fee\nfee\nFie\nFoe\nfum\n-argv23-1-fee\nFie\nFoe\nfum\n]