[vlc-commits] darwin: fix proxy URL format (fixes #19803)

Rémi Denis-Courmont git at videolan.org
Tue Feb 20 19:26:27 CET 2018


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Feb 20 20:23:11 2018 +0200| [a992da82cd4f3d273a0d23a63ca0b803eef879ea] | committer: Rémi Denis-Courmont

darwin: fix proxy URL format (fixes #19803)

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a992da82cd4f3d273a0d23a63ca0b803eef879ea
---

 src/darwin/netconf.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/src/darwin/netconf.c b/src/darwin/netconf.c
index d5f66664a4..6ab9044319 100644
--- a/src/darwin/netconf.c
+++ b/src/darwin/netconf.c
@@ -62,11 +62,8 @@ char *vlc_getProxyUrl(const char *url)
             char host_buffer[4096];
             memset(host_buffer, 0, sizeof(host_buffer));
             if (CFStringGetCString(proxyCFstr, host_buffer, sizeof(host_buffer)
-                                   - 1, kCFStringEncodingUTF8)) {
-                char buffer[4096];
-                sprintf(buffer, "%s:%d", host_buffer, port);
-                proxy_url = strdup(buffer);
-            }
+                                   - 1, kCFStringEncodingUTF8))
+                asprintf(&proxy_url, "http://%s:%d", host_buffer, port);
         }
 
         CFRelease(dicRef);



More information about the vlc-commits mailing list