summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@gmail.com>2013-10-31 13:58:46 +0100
committerDavid Herrmann <dh.herrmann@gmail.com>2013-10-31 13:58:46 +0100
commit4f05a205dca997a73f893846b77954ffb24cb51b (patch)
tree7c32ee9b9d84c6981fa09abdd08d49f115b002d4
parentcefa7d3487c988187230476d5518f3e8699e63a7 (diff)
owfd: rtsp: remove trailing whitespace in headers
Trailing whitespace are ignored in headers. Remove them. Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
-rw-r--r--src/rtsp_decoder.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/rtsp_decoder.c b/src/rtsp_decoder.c
index b5e43f0..73c643e 100644
--- a/src/rtsp_decoder.c
+++ b/src/rtsp_decoder.c
@@ -212,6 +212,10 @@ static size_t sanitize_header_line(struct owfd_rtsp_decoder *dec,
/* terminate string with binary zero */
*dst = 0;
+ /* remove trailing whitespace */
+ while (dst > line && *(dst - 1) == ' ')
+ *--dst = 0;
+
return dst - line;
}