diff mbox series

[FFmpeg-devel,3/3] avformat/url: remove duplicate call to strstr

Message ID 20200727105629.5510-3-josef@pex.com
State New
Headers show
Series [FFmpeg-devel,1/3] avformat/url: fix logic for removing ".." path components | expand

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Zlomek, Josef July 27, 2020, 10:56 a.m. UTC
Signed-off-by: Josef Zlomek <josef@pex.com>
---
 libavformat/url.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)
diff mbox series

Patch

diff --git a/libavformat/url.c b/libavformat/url.c
index ccaa28a1ed..28d12fd3de 100644
--- a/libavformat/url.c
+++ b/libavformat/url.c
@@ -186,14 +186,11 @@  void ff_make_absolute_url(char *buf, int size, const char *base,
 
     root = p = buf;
     /* Get the path root of the url which start by "://" */
-    if (p && strstr(p, "://")) {
-        sep = strstr(p, "://");
-        if (sep) {
-            sep += 3;
-            root = strchr(sep, '/');
-            if (!root)
-                return;
-        }
+    if (p && (sep = strstr(p, "://"))) {
+        sep += 3;
+        root = strchr(sep, '/');
+        if (!root)
+            return;
     }
 
     /* Remove the file name from the base url */