Skip to contentSkip to conversation

nvme-cli: netapp plugin handle empty strings

PATCH New Schremmer, Steven 2 participants 2 messages Aug 23, 2018 NVMe

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nvme-cli: netapp plugin handle empty strings

Handle controller fields with strings of length 0.

Signed-off-by Steve Schremmer <steve.schremmer at netapp.com>
---
 netapp-nvme.c | 3 +++
 1 file changed, 3 insertions(+)
netapp-nvme.c +3 -0
index 1167db4..b369913 100644
@@ -63,6 +63,9 @@ static void netapp_convert_string(char *dst, char *src, unsigned int count)
 	memset(dst, 0, count + 1);
 	for (i = 0; i < count; i++)
 		dst[i] = src[i * 2 + 1];
+	/* the json routines won't accept empty strings */
+	if (strlen(dst) == 0 && count)
+		dst[0] = ' ';
 }
 
 static void netapp_nguid_to_str(char *str, __u8 *nguid)
Signature · 1 line
2.18.0
Applied
#1 lore raw

PATCH 1/1 nvme-cli: netapp plugin handle empty strings

Quoted 3 lines · Steven

Handle controller fields with strings of length 0.

Signed-off-by Steve Schremmer <steve.schremmer at netapp.com>

Applied.