[vlc-commits] [Git][videolan/vlc][master] access: use strtok_r() in srt_url_parse_query()

Steve Lhomme (@robUx4) gitlab at videolan.org
Sat Jun 24 12:47:53 UTC 2023



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
39e1b723 by Fatih Uzunoglu at 2023-06-24T12:32:01+00:00
access: use strtok_r() in srt_url_parse_query()

- - - - -


1 changed file:

- modules/access/srt_common.c


Changes:

=====================================
modules/access/srt_common.c
=====================================
@@ -60,13 +60,14 @@ static int srt_url_parse_query(char *query, const char* delimiter,
 {
     int i = 0;
     char *token = NULL;
+    char *saveptr = NULL;
 
     if (!query || *query == '\0')
         return -1;
     if (!params || max_params == 0)
         return 0;
 
-    token = strtok( query, delimiter );
+    token = strtok_r( query, delimiter, &saveptr );
     while (token != NULL && i < max_params) {
         params[i].key = token;
         params[i].val = NULL;
@@ -85,7 +86,7 @@ static int srt_url_parse_query(char *query, const char* delimiter,
                     i++;
             };
         }
-        token = strtok( NULL, delimiter );
+        token = strtok_r( NULL, delimiter, &saveptr );
     }
     return i;
 }



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/39e1b7237baaeed846c7ccda59d55dcdba7430d8

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/39e1b7237baaeed846c7ccda59d55dcdba7430d8
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