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:
parent
58e46b9469
commit
1698689412
@ -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++;
|
||||
|
Loading…
Reference in New Issue
Block a user