summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@gmail.com>2013-10-31 12:02:08 +0100
committerDavid Herrmann <dh.herrmann@gmail.com>2013-10-31 13:58:39 +0100
commitcefa7d3487c988187230476d5518f3e8699e63a7 (patch)
tree06f0a325858023292d91642675937c56e1f4de25
parent174169e144d89fddbae531ae68ca04d9c3377e5f (diff)
owfd: rtsp: fix last-char when sanitizing headers
If we replace characters, we need to also set the last_c char. Otherwise, the "prev" char will not reflect the change. Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
-rw-r--r--src/rtsp_decoder.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/rtsp_decoder.c b/src/rtsp_decoder.c
index 68f5866..b5e43f0 100644
--- a/src/rtsp_decoder.c
+++ b/src/rtsp_decoder.c
@@ -197,8 +197,10 @@ static size_t sanitize_header_line(struct owfd_rtsp_decoder *dec,
continue;
/* turn new-lines/tabs into white-space */
- if (c == '\r' || c == '\n' || c == '\t')
+ if (c == '\r' || c == '\n' || c == '\t') {
c = ' ';
+ last_c = c;
+ }
/* trim whitespace */
if (c == ' ' && prev == ' ')