--- old/nrpe.c	2007-04-27 20:35:10.000000000 +0200
+++ nrpe.c	2007-04-27 20:37:00.000000000 +0200
@@ -1322,13 +1322,8 @@
 		        }
 		else{
 
-			/* read in the first line of output from the command */
-			strcpy(buffer,"");
-			fgets(buffer,sizeof(buffer)-1,fp);
-
-			/* ADDED 01/19/2004 */
-			/* ignore any additional lines of output */
-			while(fgets(temp_buffer,sizeof(temp_buffer)-1,fp));
+			/* read in the output from the command */
+			bytes_read=fread(buffer,1,sizeof(buffer)-1,fp);
 
 			/* close the command and get termination status */
 			status=pclose(fp);
@@ -1340,7 +1335,7 @@
 				result=WEXITSTATUS(status);
 
 			/* write the output back to the parent process */
-			write(fd[1],buffer,strlen(buffer)+1);
+			write(fd[1],buffer,bytes_read);
 		        }
 
 		/* close pipe for writing */
