The NVMe host id is a UUID with the string length 36. As the
read() call uses the passed-in length minus one we need to
increase the host ID length by one to avoid nvmf_read_file(f,
NVMF_HOSTID_LEN) skipping the last character.
Signed-off-by: Hannes Reinecke <hare@suse.de>
#include "ioctl.h"
#include "util.h"
-#define NVMF_HOSTID_SIZE 36
+#define NVMF_HOSTID_SIZE 37
const char *nvmf_dev = "/dev/nvme-fabrics";
const char *nvmf_hostnqn_file = "/etc/nvme/hostnqn";
return false;
memset(buf, 0, len);
- ret = read(fd, buf, sizeof(buf - 1));
+ ret = read(fd, buf, len - 1);
close (fd);
if (ret < 0)