From bef64755f100a02524eef4ac84294d6991344a4e Mon Sep 17 00:00:00 2001 From: Klaus Jensen Date: Mon, 6 Apr 2020 09:06:36 +0200 Subject: [PATCH] nvme-print: fix namespace descriptor human printing 9b2ce6ca3ba7 fixed the len accumulation, but only for the JSON printing. Fix it for human output as well. Reported-by: Narae Park Signed-off-by: Klaus Jensen --- nvme-print.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nvme-print.c b/nvme-print.c index dc491cf..42e27a3 100644 --- a/nvme-print.c +++ b/nvme-print.c @@ -2622,7 +2622,7 @@ void nvme_show_id_ns_descs(void *data, unsigned nsid, enum nvme_print_flags flag for (i = 0; i < 8; i++) printf("%02x", eui64[i]); printf("\n"); - len += sizeof(eui64); + len = sizeof(eui64); break; case NVME_NIDT_NGUID: memcpy(nguid, data + pos + sizeof(*cur), sizeof(nguid)); @@ -2630,14 +2630,14 @@ void nvme_show_id_ns_descs(void *data, unsigned nsid, enum nvme_print_flags flag for (i = 0; i < 16; i++) printf("%02x", nguid[i]); printf("\n"); - len += sizeof(nguid); + len = sizeof(nguid); break; #ifdef LIBUUID case NVME_NIDT_UUID: memcpy(uuid, data + pos + sizeof(*cur), 16); uuid_unparse_lower(uuid, uuid_str); printf("uuid : %s\n", uuid_str); - len += sizeof(uuid); + len = sizeof(uuid); break; #endif default: -- 2.49.0