From d563f3ca2040afc85780dc2e28eece59689b47d5 Mon Sep 17 00:00:00 2001
From: Ansuel Smith <ansuelsmth@gmail.com>
Date: Sun, 16 Jun 2019 19:00:47 +0200
Subject: [PATCH] libblkid-tiny: fix wrong btrfs label length

Btrfs label length is 256 included the termination char ( '\0' ) as the real max length is 255 (less than 256 from the wiki).

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
---
 libblkid-tiny/btrfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libblkid-tiny/btrfs.c b/libblkid-tiny/btrfs.c
index 7ce3dff..cf33db5 100644
--- a/libblkid-tiny/btrfs.c
+++ b/libblkid-tiny/btrfs.c
@@ -70,7 +70,7 @@ static int probe_btrfs(blkid_probe pr, const struct blkid_idmag *mag)
 	if (*bfs->label)
 		blkid_probe_set_label(pr,
 				(unsigned char *) bfs->label,
-				sizeof(bfs->label));
+				sizeof(bfs->label) - 1);
 
 	blkid_probe_set_uuid(pr, bfs->fsid);
 	blkid_probe_set_uuid_as(pr, bfs->dev_item.uuid, "UUID_SUB");
-- 
2.25.1