[vlc-commits] [Git][videolan/vlc][3.0.x] upnp: Correct top directory url formatting

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Mon Apr 11 12:44:34 UTC 2022



Jean-Baptiste Kempf pushed to branch 3.0.x at VideoLAN / VLC


Commits:
89f04db7 by Alaric Senat at 2022-04-11T12:24:03+00:00
upnp: Correct top directory url formatting

As pointed out in #25055 the choice of url option delimiter is probably
meant to be that way. std::string.find() returns std::string::npos (aka
-1) in case of no match.

Signed-off-by: Thomas Guillem <thomas at gllm.fr>
(cherry picked from commit f5f5a0d0ddb6c96ab08a6b3ca1115dcbd2ae2c77)

- - - - -


1 changed file:

- modules/services_discovery/upnp.cpp


Changes:

=====================================
modules/services_discovery/upnp.cpp
=====================================
@@ -352,7 +352,7 @@ bool MediaServerList::addServer( MediaServerDesc* desc )
     } else {
         char* psz_mrl;
         // We might already have some options specified in the location.
-        char opt_delim = desc->location.find( '?' ) == 0 ? '?' : '&';
+        char opt_delim = desc->location.find( '?' ) == std::string::npos ? '?' : '&';
         if( asprintf( &psz_mrl, "upnp://%s%cObjectID=0", desc->location.c_str(), opt_delim ) < 0 )
             return false;
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/89f04db7926141b1409ea4a00661665f7771b375

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/89f04db7926141b1409ea4a00661665f7771b375
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list