Commit d9fcd324 authored by rbultje's avatar rbultje

strchr(string, '\0') returns non-NULL, and is thus not suited for use in

redir_isspace(char) to check if '\0' is a space or not. Therefore, we now
use memchr(), since then we can give the length of the string (i.e. the
length excluding the terminating '\0'). Fixes issue 919, see also the
follow-ups in the "[PATCH] rtsp.c small cleanups" mailinglist thread.



git-svn-id: file:///var/local/repositories/ffmpeg/trunk@18177 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent f4b4a842
...@@ -55,7 +55,9 @@ static int rtsp_probe(AVProbeData *p) ...@@ -55,7 +55,9 @@ static int rtsp_probe(AVProbeData *p)
} }
#define SPACE_CHARS " \t\r\n" #define SPACE_CHARS " \t\r\n"
#define redir_isspace(c) strchr(SPACE_CHARS, c) /* we use memchr() instead of strchr() here because strchr() will return
* the terminating '\0' of SPACE_CHARS instead of NULL if c is '\0'. */
#define redir_isspace(c) memchr(SPACE_CHARS, c, 4)
static void skip_spaces(const char **pp) static void skip_spaces(const char **pp)
{ {
const char *p; const char *p;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment