[vlc-commits] playlist demux: do not use index()

Rafaël Carré git at videolan.org
Tue Dec 3 09:15:27 CET 2013


vlc | branch: master | Rafaël Carré <funman at videolan.org> | Tue Dec  3 09:14:16 2013 +0100| [78bd79f227a6db422fe651a6c1f9f626fa4a40a3] | committer: Rafaël Carré

playlist demux: do not use index()

marked as LEGACY in POSIX.1-2001.
POSIX.1-2008 removes the  specifications  of  index()
and rindex(), recommending strchr(3) and strrchr(3) instead.

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

 modules/demux/playlist/playlist.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/demux/playlist/playlist.c b/modules/demux/playlist/playlist.c
index ed0e54d..0b4a053 100644
--- a/modules/demux/playlist/playlist.c
+++ b/modules/demux/playlist/playlist.c
@@ -241,7 +241,7 @@ bool CheckContentType( stream_t * p_stream, const char * psz_ctype )
     }
 
     /* check for Content-Type: foo-type; charset=... */
-    const char * psz_sep = index( psz_check, ';' );
+    const char * psz_sep = strchr( psz_check, ';' );
     if ( psz_sep )
         i_len = __MIN( i_len, psz_sep - psz_check );
 



More information about the vlc-commits mailing list