From: Florian Forster Date: Tue, 24 Jun 2008 12:43:15 +0000 (+0200) Subject: src/rrd_daemon.c: Accept \r\n style line endings, too. X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=988145267641ad67f8625f43eb6f1642b8d05b6e;p=rrdtool.git src/rrd_daemon.c: Accept \r\n style line endings, too. --- diff --git a/src/rrd_daemon.c b/src/rrd_daemon.c index 0e2d2df..4def10c 100644 --- a/src/rrd_daemon.c +++ b/src/rrd_daemon.c @@ -637,6 +637,14 @@ static int handle_request (int fd) /* {{{ */ RRDD_LOG (LOG_INFO, "handle_request: malformed request."); return (-1); } + + /* Accept Windows style line endings, too */ + if ((buffer_size > 2) && (buffer[buffer_size - 2] == '\r')) + { + buffer_size--; + buffer[buffer_size - 1] = '\n'; + } + /* Place the normal field separator at the end to simplify * `buffer_get_field's work. */ buffer[buffer_size - 1] = ' ';