Skip to content
Snippets Groups Projects
Commit a955fc5e authored by Martin Storsjö's avatar Martin Storsjö
Browse files

ff_url_join: Don't add any at-char if the auth is an empty string

Originally committed as revision 23650 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 6217b645
No related branches found
No related tags found
No related merge requests found
...@@ -131,7 +131,8 @@ void ff_url_split(char *proto, int proto_size, ...@@ -131,7 +131,8 @@ void ff_url_split(char *proto, int proto_size,
* @param size the size of the str buffer * @param size the size of the str buffer
* @param proto the protocol identifier, if null, the separator * @param proto the protocol identifier, if null, the separator
* after the identifier is left out, too * after the identifier is left out, too
* @param authorization an optional authorization string, may be null * @param authorization an optional authorization string, may be null.
* An empty string is treated the same as a null string.
* @param hostname the host name string * @param hostname the host name string
* @param port the port number, left out from the string if negative * @param port the port number, left out from the string if negative
* @param fmt a generic format string for everything to add after the * @param fmt a generic format string for everything to add after the
......
...@@ -3601,7 +3601,7 @@ int ff_url_join(char *str, int size, const char *proto, ...@@ -3601,7 +3601,7 @@ int ff_url_join(char *str, int size, const char *proto,
str[0] = '\0'; str[0] = '\0';
if (proto) if (proto)
av_strlcatf(str, size, "%s://", proto); av_strlcatf(str, size, "%s://", proto);
if (authorization) if (authorization && authorization[0])
av_strlcatf(str, size, "%s@", authorization); av_strlcatf(str, size, "%s@", authorization);
#if CONFIG_NETWORK && defined(AF_INET6) #if CONFIG_NETWORK && defined(AF_INET6)
/* Determine if hostname is a numerical IPv6 address, /* Determine if hostname is a numerical IPv6 address,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment