Index: test/testcpg.c
===================================================================
--- test/testcpg.c	(revision 2078)
+++ test/testcpg.c	(working copy)
@@ -166,6 +166,7 @@
 	const char *options = "i";
 	int opt;
 	unsigned int nodeid;
+	char *fgets_res;
 
 	while ( (opt = getopt(argc, argv, options)) != -1 ) {
 		switch (opt) {
@@ -216,7 +217,10 @@
 			char inbuf[132];
 			struct iovec iov;
 
-			fgets(inbuf, sizeof(inbuf), stdin);
+			fgets_res = fgets(inbuf, sizeof(inbuf), stdin);
+			if (fgets_res == NULL) {
+				cpg_leave(handle, &group_name);
+			}
 			if (strncmp(inbuf, "EXIT", 4) == 0) {
 				cpg_leave(handle, &group_name);
 			}
_______________________________________________
Openais mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/openais

Reply via email to