[vlc-commits] [Git][videolan/vlc][master] process: Replace an assert with a check

Steve Lhomme (@robUx4) gitlab at videolan.org
Thu Jul 9 13:49:24 UTC 2026



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
de087ed6 by Gabriel Lafond-Thenaille at 2026-07-09T13:05:28+00:00
process: Replace an assert with a check

Apply the same logic that the win32 implementation. Remove in the
`vlc_process_Spawn` the assert on the argc for being different than
zero.

- - - - -


2 changed files:

- include/vlc_process.h
- src/posix/process.c


Changes:

=====================================
include/vlc_process.h
=====================================
@@ -30,8 +30,9 @@
  *
  * @param [in]  path    Path to the executable to run. Must not be NULL.
  * @param [in]  argc    Number of arguments passed to the process (must be
- *                      greater than 0).
- * @param [in]  argv    Array of argument strings (argv[0] must not be NULL).
+ *                      greater than or equal to 0).
+ * @param [in]  argv    Array of argument strings. May be NULL if argc is 0;
+ *                      otherwise argv[0] must not be NULL.
  *
  * @return      A pointer to the newly created vlc_process structure on
  *              success, or NULL on failure.


=====================================
src/posix/process.c
=====================================
@@ -42,9 +42,10 @@ struct vlc_process*
 vlc_process_Spawn(const char *path, int argc, const char *const *argv)
 {
     assert(path != NULL);
-    assert(argc > 0);
-    assert(argv != NULL);
-    assert(argv[0] != NULL);
+    if (argc > 0) {
+        assert(argv != NULL);
+        assert(argv[0] != NULL);
+    }
 
     int ret = VLC_EGENERIC;
     int fds[2] = { -1, -1 };



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

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/de087ed64b154830baff688b302b0e2796206a44
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help




More information about the vlc-commits mailing list