]> git.sesse.net Git - vlc/commitdiff
Fix a bug.
authorAntoine Cellerier <dionoea@videolan.org>
Fri, 27 Apr 2007 21:21:39 +0000 (21:21 +0000)
committerAntoine Cellerier <dionoea@videolan.org>
Fri, 27 Apr 2007 21:21:39 +0000 (21:21 +0000)
modules/control/rc.c

index 168779f4e2e99b180454a1a17d5a81c0db3b0ba3..ee65c7be84eb69dffc750be7f77582d60d948e52 100644 (file)
@@ -606,16 +606,23 @@ static void Run( intf_thread_t *p_intf )
             char *psz_myarg = strchr( psz_mycmd, ' ' );
             char *psz_msg;
 
-            *psz_myarg = '\0';
-            psz_myarg ++;
-
-            var_Command( p_input, psz_alias, psz_mycmd, psz_myarg, &psz_msg );
+            if( !psz_myarg )
+            {
+                msg_rc( "Not enough parameters." );
+            }
+            else
+            {
+                *psz_myarg = '\0';
+                psz_myarg ++;
 
+                var_Command( p_intf, psz_alias, psz_mycmd, psz_myarg,
+                             &psz_msg );
 
-            if( psz_msg )
-            {
-                msg_rc( psz_msg );
-                free( psz_msg );
+                if( psz_msg )
+                {
+                    msg_rc( psz_msg );
+                    free( psz_msg );
+                }
             }
             free( psz_mycmd );
         }