diff gopher.c @ 5756:7c7fe75728dd libavformat

Use ff_url_join for assembling URLs, instead of snprintf This ensures proper escaping of numerical IPv6 addresses. The RTSP (de)muxer needs its own network initialization, since it isn't a protocol and url_open hasn't been called yet.
author mstorsjo
date Fri, 05 Mar 2010 22:35:21 +0000
parents 1842e64fe89a
children 7a123cc24a81
line wrap: on
line diff
--- a/gopher.c	Fri Mar 05 22:31:45 2010 +0000
+++ b/gopher.c	Fri Mar 05 22:35:21 2010 +0000
@@ -95,7 +95,7 @@
     if (port < 0)
         port = 70;
 
-    snprintf(buf, sizeof(buf), "tcp://%s:%d", hostname, port);
+    ff_url_join(buf, sizeof(buf), "tcp", NULL, hostname, port, NULL);
 
     s->hd = NULL;
     err = url_open(&s->hd, buf, URL_RDWR);