nvme-cli: netapp plugin handle empty strings
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
@@ -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
Keith Busch
AppliedPATCH 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.