Skip to content

Commit

Permalink
Fix incorrect sprintf return code checking
Browse files Browse the repository at this point in the history
  • Loading branch information
xyan264 committed Nov 9, 2020
1 parent bf5a452 commit 55ccc15
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nvme-topology.c
Original file line number Diff line number Diff line change
Expand Up @@ -357,9 +357,9 @@ static int verify_legacy_ns(struct nvme_namespace *n)
char tmp_address[64] = "";
legacy_get_pci_bdf(path, tmp_address);
if (tmp_address[0]) {
if (asprintf(&n->ctrl->transport, "pcie") != 1)
if (asprintf(&n->ctrl->transport, "pcie") < 0)
return -1;
if (asprintf(&n->ctrl->address, "%s", tmp_address) != 1)
if (asprintf(&n->ctrl->address, "%s", tmp_address) < 0)
return -1;
}
}
Expand Down

0 comments on commit 55ccc15

Please sign in to comment.