diff options
author | bertrand <bertrand@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2001-12-14 20:45:30 +0000 |
---|---|---|
committer | bertrand <bertrand@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2001-12-14 20:45:30 +0000 |
commit | 3ea29912ef6367871359b6d2d66f23a1fc4e9c5c (patch) | |
tree | 01f4d0f63b788c4d59115c86736c23b15c0831b9 /libmpdemux/url.c | |
parent | 5b38c5c2515efe76b35259b817bcbb9deebf09bf (diff) | |
download | mpv-3ea29912ef6367871359b6d2d66f23a1fc4e9c5c.tar.bz2 mpv-3ea29912ef6367871359b6d2d66f23a1fc4e9c5c.tar.xz |
Applied the patch from Alban Bedel <albeu@free.fr>.
He added some errors checking on network code.
Added a check on the port number parsing in the url.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@3495 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux/url.c')
-rw-r--r-- | libmpdemux/url.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libmpdemux/url.c b/libmpdemux/url.c index 0ace717d90..410664368c 100644 --- a/libmpdemux/url.c +++ b/libmpdemux/url.c @@ -17,7 +17,7 @@ URL_t* url_new(char* url) { int pos1, pos2; URL_t* Curl; - char *ptr1, *ptr2; + char *ptr1, *ptr2, *ptr3; // Create the URL container Curl = (URL_t*)malloc(sizeof(URL_t)); @@ -49,6 +49,9 @@ url_new(char* url) { // look if the port is given ptr2 = strstr(ptr1+3, ":"); + // If the : is after the first / it isn't the port + ptr3 = strstr(ptr1+3, "/"); + if(ptr3 && ptr3 - ptr2 < 0) ptr2 = NULL; if( ptr2==NULL ) { // No port is given // Look if a path is given |