From 134bdf622fd677013ea99d75aa2b232839ed5c8a Mon Sep 17 00:00:00 2001
From: Matthias Goergens <matthias.goergens@gmail.com>
Date: Tue, 23 Jul 2024 14:26:07 +0800
Subject: [PATCH] Fix allow empty passphrases in `unlock`

Fixes issues https://github.com/koverstreet/bcachefs-tools/issues/314
---
 c_src/tools-util.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/c_src/tools-util.c b/c_src/tools-util.c
index 43c9b789..ed752479 100644
--- a/c_src/tools-util.c
+++ b/c_src/tools-util.c
@@ -124,10 +124,6 @@ char *read_file_str(int dirfd, const char *path)
 	buf[len] = '\0';
 	if (len && buf[len - 1] == '\n')
 		buf[len - 1] = '\0';
-	if (!strlen(buf)) {
-		free(buf);
-		buf = NULL;
-	}
 
 	close(fd);