[Nagios-devel] [PATCH 2/3] Print a newline to the FIFO when

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Guest

[Nagios-devel] [PATCH 2/3] Print a newline to the FIFO when

Post by Guest »

This is a multi-part message in MIME format.
--------------050308000500010207060009
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

puts() adds a newline, but fputs() does not. This had me
fooled for while, and could make cmd.cgi behave poorly
at times.

Spotted-by: Olivier Beytrison
Debugged-by: Hendrik Baecker
Signed-off-by: Andreas Ericsson
---
cgi/cmd.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)



--------------050308000500010207060009
Content-Type: text/x-patch;
name="ced136bfec8a3e988f1ad5ca155662fee341e197.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="ced136bfec8a3e988f1ad5ca155662fee341e197.diff"

diff --git a/cgi/cmd.c b/cgi/cmd.c
index 3a9e76d..89cb216 100644
--- a/cgi/cmd.c
+++ b/cgi/cmd.c
@@ -2269,7 +2269,7 @@ int write_command_to_file(char *cmd){
}

/* write the command to file */
- fputs(cmd,fp);
+ fprintf(fp, "%s\n", cmd);

/* flush buffer */
fflush(fp);


--------------050308000500010207060009--





This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
Locked