nvme_manage: handle fgets() failure

fgets() will return NULL if it encounters EOF.

Change-Id: I35b1744514f2a90d6e95156c3916a18c1a4ecce2
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
Daniel Verkamp 2016-03-15 14:36:52 -07:00
parent 58e46b9469
commit 1698689412

View File

@ -240,6 +240,9 @@ get_controller(void)
while ((ch = getchar()) != '\n' && ch != EOF);
p = fgets(address, 64, stdin);
if (p == NULL) {
return NULL;
}
while (isspace(*p)) {
p++;