Commit 16986894 authored by Daniel Verkamp's avatar Daniel Verkamp
Browse files

nvme_manage: handle fgets() failure



fgets() will return NULL if it encounters EOF.

Change-Id: I35b1744514f2a90d6e95156c3916a18c1a4ecce2
Signed-off-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
parent 58e46b94
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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++;