Commit b82f3377 authored by Gildas Bazin's avatar Gildas Bazin

* src/misc/vlm.c: partial revert of commit 9353. Do not use strncmp() when it...

* src/misc/vlm.c: partial revert of commit 9353. Do not use strncmp() when it isn't needed. It just makes the code less readable and more prone to bugs.
parent 139f7409
...@@ -302,7 +302,7 @@ static int ExecuteCommand( vlm_t *p_vlm, char *psz_command, ...@@ -302,7 +302,7 @@ static int ExecuteCommand( vlm_t *p_vlm, char *psz_command,
goto success; goto success;
} }
if( strncmp(ppsz_command[0], "new", 3 ) == 0 ) if( !strcmp(ppsz_command[0], "new") )
{ {
int i_type; int i_type;
...@@ -310,29 +310,30 @@ static int ExecuteCommand( vlm_t *p_vlm, char *psz_command, ...@@ -310,29 +310,30 @@ static int ExecuteCommand( vlm_t *p_vlm, char *psz_command,
if( i_command < 3 ) goto syntax_error; if( i_command < 3 ) goto syntax_error;
/* Get type */ /* Get type */
if( strncmp(ppsz_command[2], "vod", 3 ) == 0 ) if( !strcmp(ppsz_command[2], "vod") )
{ {
i_type = VOD_TYPE; i_type = VOD_TYPE;
} }
else if( strncmp(ppsz_command[2], "broadcast", 9 ) == 0 ) else if( !strcmp(ppsz_command[2], "broadcast") )
{ {
i_type = BROADCAST_TYPE; i_type = BROADCAST_TYPE;
} }
else if( strncmp(ppsz_command[2], "schedule", 8 ) == 0 ) else if( !strcmp(ppsz_command[2], "schedule") )
{ {
i_type = SCHEDULE_TYPE; i_type = SCHEDULE_TYPE;
} }
else else
{ {
p_message = vlm_MessageNew( "new", "%s: Choose between vod, " p_message =
vlm_MessageNew( "new", "%s: Choose between vod, "
"broadcast or schedule", ppsz_command[1] ); "broadcast or schedule", ppsz_command[1] );
goto error; goto error;
} }
/* Check for forbidden media names */ /* Check for forbidden media names */
if( strncmp(ppsz_command[1], "all", 3 ) == 0 || if( !strcmp(ppsz_command[1], "all") ||
strncmp(ppsz_command[1], "media", 5) == 0 || !strcmp(ppsz_command[1], "media") ||
strncmp(ppsz_command[1], "schedule", 8) == 0 ) !strcmp(ppsz_command[1], "schedule") )
{ {
p_message = vlm_MessageNew( "new", "\"all\", \"media\" and " p_message = vlm_MessageNew( "new", "\"all\", \"media\" and "
"\"schedule\" are reserved names" ); "\"schedule\" are reserved names" );
...@@ -381,14 +382,14 @@ static int ExecuteCommand( vlm_t *p_vlm, char *psz_command, ...@@ -381,14 +382,14 @@ static int ExecuteCommand( vlm_t *p_vlm, char *psz_command,
/* Properties will be dealt with later on */ /* Properties will be dealt with later on */
} }
else if( strncmp(ppsz_command[0], "setup", 5) == 0 ) else if( !strcmp(ppsz_command[0], "setup") )
{ {
if( i_command < 2 ) goto syntax_error; if( i_command < 2 ) goto syntax_error;
/* Properties will be dealt with later on */ /* Properties will be dealt with later on */
} }
else if( strncmp(ppsz_command[0], "del", 3) == 0 ) else if( !strcmp(ppsz_command[0], "del") )
{ {
vlm_media_t *p_media; vlm_media_t *p_media;
vlm_schedule_t *p_schedule; vlm_schedule_t *p_schedule;
...@@ -406,17 +407,17 @@ static int ExecuteCommand( vlm_t *p_vlm, char *psz_command, ...@@ -406,17 +407,17 @@ static int ExecuteCommand( vlm_t *p_vlm, char *psz_command,
{ {
vlm_MediaDelete( p_vlm, p_media, NULL ); vlm_MediaDelete( p_vlm, p_media, NULL );
} }
else if( strncmp(ppsz_command[1], "media", 5 ) == 0 ) else if( !strcmp(ppsz_command[1], "media") )
{ {
while( p_vlm->i_media ) vlm_MediaDelete( p_vlm, p_vlm->media[0], while( p_vlm->i_media ) vlm_MediaDelete( p_vlm, p_vlm->media[0],
NULL ); NULL );
} }
else if( strncmp(ppsz_command[1], "schedule", 8) == 0 ) else if( !strcmp(ppsz_command[1], "schedule") )
{ {
while( p_vlm->i_schedule ) while( p_vlm->i_schedule )
vlm_ScheduleDelete( p_vlm, p_vlm->schedule[0], NULL ); vlm_ScheduleDelete( p_vlm, p_vlm->schedule[0], NULL );
} }
else if( strncmp(ppsz_command[1], "all", 3 ) == 0 ) else if( !strcmp(ppsz_command[1], "all") )
{ {
while( p_vlm->i_media ) vlm_MediaDelete( p_vlm, p_vlm->media[0], while( p_vlm->i_media ) vlm_MediaDelete( p_vlm, p_vlm->media[0],
NULL ); NULL );
...@@ -435,7 +436,7 @@ static int ExecuteCommand( vlm_t *p_vlm, char *psz_command, ...@@ -435,7 +436,7 @@ static int ExecuteCommand( vlm_t *p_vlm, char *psz_command,
goto success; goto success;
} }
else if( strncmp(ppsz_command[0], "show", 4) == 0 ) else if( !strcmp(ppsz_command[0], "show") )
{ {
vlm_media_t *p_media; vlm_media_t *p_media;
vlm_schedule_t *p_schedule; vlm_schedule_t *p_schedule;
...@@ -466,7 +467,7 @@ static int ExecuteCommand( vlm_t *p_vlm, char *psz_command, ...@@ -466,7 +467,7 @@ static int ExecuteCommand( vlm_t *p_vlm, char *psz_command,
goto success; goto success;
} }
else if( strncmp( ppsz_command[0], "help", 4 ) == 0 ) else if( !strcmp(ppsz_command[0], "help") )
{ {
if( i_command != 1 ) goto syntax_error; if( i_command != 1 ) goto syntax_error;
...@@ -474,7 +475,7 @@ static int ExecuteCommand( vlm_t *p_vlm, char *psz_command, ...@@ -474,7 +475,7 @@ static int ExecuteCommand( vlm_t *p_vlm, char *psz_command,
goto success; goto success;
} }
else if( strncmp(ppsz_command[0], "control", 7) == 0 ) else if( !strcmp(ppsz_command[0], "control") )
{ {
vlm_media_t *p_media; vlm_media_t *p_media;
...@@ -491,10 +492,10 @@ static int ExecuteCommand( vlm_t *p_vlm, char *psz_command, ...@@ -491,10 +492,10 @@ static int ExecuteCommand( vlm_t *p_vlm, char *psz_command,
char *psz_command, *psz_arg = 0, *psz_instance = 0; char *psz_command, *psz_arg = 0, *psz_instance = 0;
int i_index = 2; int i_index = 2;
if( strncmp(ppsz_command[2], "play", 4) && if( strcmp( ppsz_command[2], "play" ) &&
strncmp(ppsz_command[2], "stop", 4) && strcmp( ppsz_command[2], "stop" ) &&
strncmp(ppsz_command[2], "pause", 5) && strcmp( ppsz_command[2], "pause" ) &&
strncmp(ppsz_command[2], "seek", 4) ) strcmp( ppsz_command[2], "seek" ) )
{ {
i_index++; i_index++;
psz_instance = ppsz_command[2]; psz_instance = ppsz_command[2];
...@@ -513,7 +514,7 @@ static int ExecuteCommand( vlm_t *p_vlm, char *psz_command, ...@@ -513,7 +514,7 @@ static int ExecuteCommand( vlm_t *p_vlm, char *psz_command,
} }
} }
else if( strncmp(ppsz_command[0], "save", 4) == 0 ) else if( !strcmp(ppsz_command[0], "save") )
{ {
FILE *file; FILE *file;
...@@ -541,7 +542,7 @@ static int ExecuteCommand( vlm_t *p_vlm, char *psz_command, ...@@ -541,7 +542,7 @@ static int ExecuteCommand( vlm_t *p_vlm, char *psz_command,
} }
} }
else if( strncmp(ppsz_command[0], "load", 4) == 0 ) else if( !strcmp(ppsz_command[0], "load") )
{ {
FILE *file; FILE *file;
...@@ -599,10 +600,10 @@ static int ExecuteCommand( vlm_t *p_vlm, char *psz_command, ...@@ -599,10 +600,10 @@ static int ExecuteCommand( vlm_t *p_vlm, char *psz_command,
} }
/* Common code between "new" and "setup" */ /* Common code between "new" and "setup" */
if( strncmp(ppsz_command[0], "new", 3) == 0 || if( !strcmp(ppsz_command[0], "new") ||
strncmp(ppsz_command[0], "setup", 5) == 0 ) !strcmp(ppsz_command[0], "setup") )
{ {
int i_command_start = strncmp(ppsz_command[0], "new",3 ) ? 2 : 3; int i_command_start = strcmp(ppsz_command[0], "new") ? 2 : 3;
vlm_media_t *p_media; vlm_media_t *p_media;
vlm_schedule_t *p_schedule; vlm_schedule_t *p_schedule;
...@@ -622,15 +623,15 @@ static int ExecuteCommand( vlm_t *p_vlm, char *psz_command, ...@@ -622,15 +623,15 @@ static int ExecuteCommand( vlm_t *p_vlm, char *psz_command,
{ {
for( i = i_command_start ; i < i_command ; i++ ) for( i = i_command_start ; i < i_command ; i++ )
{ {
if( strncmp( ppsz_command[i], "enabled" , 7 ) == 0 || if( !strcmp( ppsz_command[i], "enabled" ) ||
strncmp( ppsz_command[i], "disabled" , 8 ) == 0 ) !strcmp( ppsz_command[i], "disabled" ) )
{ {
vlm_ScheduleSetup( p_schedule, ppsz_command[i], NULL ); vlm_ScheduleSetup( p_schedule, ppsz_command[i], NULL );
} }
/* Beware: everything behind append is considered as /* Beware: everything behind append is considered as
* command line */ * command line */
else if( strncmp( ppsz_command[i], "append", 6 ) == 0 ) else if( !strcmp( ppsz_command[i], "append" ) )
{ {
if( ++i >= i_command ) break; if( ++i >= i_command ) break;
...@@ -649,17 +650,18 @@ static int ExecuteCommand( vlm_t *p_vlm, char *psz_command, ...@@ -649,17 +650,18 @@ static int ExecuteCommand( vlm_t *p_vlm, char *psz_command,
} }
else else
{ {
if( i + 1 >= i_command && !strncmp(ppsz_command[0], if( i + 1 >= i_command && !strcmp(ppsz_command[0], "new") )
"new", 3) )
{ {
vlm_ScheduleDelete( p_vlm, p_schedule, NULL ); vlm_ScheduleDelete( p_vlm, p_schedule, NULL );
p_message = vlm_MessageNew( ppsz_command[0], p_message =
vlm_MessageNew( ppsz_command[0],
"Wrong properties syntax" ); "Wrong properties syntax" );
goto error; goto error;
} }
else if( i + 1 >= i_command ) else if( i + 1 >= i_command )
{ {
p_message = vlm_MessageNew( ppsz_command[0], p_message =
vlm_MessageNew( ppsz_command[0],
"Wrong properties syntax" ); "Wrong properties syntax" );
goto error; goto error;
} }
...@@ -675,13 +677,13 @@ static int ExecuteCommand( vlm_t *p_vlm, char *psz_command, ...@@ -675,13 +677,13 @@ static int ExecuteCommand( vlm_t *p_vlm, char *psz_command,
{ {
for( i = i_command_start ; i < i_command ; i++ ) for( i = i_command_start ; i < i_command ; i++ )
{ {
if( strncmp( ppsz_command[i], "enabled", 7 ) == 0 || if( !strcmp( ppsz_command[i], "enabled" ) ||
strncmp( ppsz_command[i], "disabled", 8 ) == 0 ) !strcmp( ppsz_command[i], "disabled" ) )
{ {
vlm_MediaSetup( p_vlm, p_media, ppsz_command[i], NULL ); vlm_MediaSetup( p_vlm, p_media, ppsz_command[i], NULL );
} }
else if( i + 1 >= i_command && !strncmp( ppsz_command[i], else if( i + 1 >= i_command &&
"mux", 3 ) ) !strcmp( ppsz_command[i], "mux") )
{ {
if( p_media->i_type != VOD_TYPE ) if( p_media->i_type != VOD_TYPE )
{ {
...@@ -695,8 +697,8 @@ static int ExecuteCommand( vlm_t *p_vlm, char *psz_command, ...@@ -695,8 +697,8 @@ static int ExecuteCommand( vlm_t *p_vlm, char *psz_command,
i++; i++;
} }
} }
else if( strncmp( ppsz_command[i], "loop" , 4 ) == 0 || else if( !strcmp( ppsz_command[i], "loop" ) ||
strncmp( ppsz_command[i], "unloop" , 6) == 0 ) !strcmp( ppsz_command[i], "unloop" ) )
{ {
if( p_media->i_type != BROADCAST_TYPE ) if( p_media->i_type != BROADCAST_TYPE )
{ {
...@@ -710,17 +712,19 @@ static int ExecuteCommand( vlm_t *p_vlm, char *psz_command, ...@@ -710,17 +712,19 @@ static int ExecuteCommand( vlm_t *p_vlm, char *psz_command,
} }
else else
{ {
if( i + 1 >= i_command && !strncmp(ppsz_command[0], if( i + 1 >= i_command &&
"new", 3) ) !strcmp(ppsz_command[0], "new") )
{ {
vlm_MediaDelete( p_vlm, p_media, NULL ); vlm_MediaDelete( p_vlm, p_media, NULL );
p_message = vlm_MessageNew( ppsz_command[0], p_message =
vlm_MessageNew( ppsz_command[0],
"Wrong properties syntax" ); "Wrong properties syntax" );
goto error; goto error;
} }
else if( i + 1 >= i_command ) else if( i + 1 >= i_command )
{ {
p_message = vlm_MessageNew( ppsz_command[0], p_message =
vlm_MessageNew( ppsz_command[0],
"Wrong properties syntax" ); "Wrong properties syntax" );
goto error; goto error;
} }
...@@ -896,29 +900,29 @@ static int vlm_MediaSetup( vlm_t *vlm, vlm_media_t *media, char *psz_cmd, ...@@ -896,29 +900,29 @@ static int vlm_MediaSetup( vlm_t *vlm, vlm_media_t *media, char *psz_cmd,
{ {
if( !psz_cmd) return VLC_EGENERIC; if( !psz_cmd) return VLC_EGENERIC;
if( strncmp( psz_cmd, "loop", 4 ) == 0 ) if( !strcmp( psz_cmd, "loop" ) )
{ {
media->b_loop = VLC_TRUE; media->b_loop = VLC_TRUE;
} }
else if( strncmp( psz_cmd, "unloop", 6 ) == 0 ) else if( !strcmp( psz_cmd, "unloop" ) )
{ {
media->b_loop = VLC_FALSE; media->b_loop = VLC_FALSE;
} }
else if( strncmp( psz_cmd, "enabled", 7 ) == 0 ) else if( !strcmp( psz_cmd, "enabled" ) )
{ {
media->b_enabled = VLC_TRUE; media->b_enabled = VLC_TRUE;
} }
else if( strncmp( psz_cmd, "disabled", 8 ) == 0 ) else if( !strcmp( psz_cmd, "disabled" ) )
{ {
media->b_enabled = VLC_FALSE; media->b_enabled = VLC_FALSE;
} }
else if( strncmp( psz_cmd, "mux", 3 ) == 0 ) else if( !strcmp( psz_cmd, "mux" ) )
{ {
if( media->psz_mux ) free( media->psz_mux ); if( media->psz_mux ) free( media->psz_mux );
media->psz_mux = NULL; media->psz_mux = NULL;
if( psz_value ) media->psz_mux = strdup( psz_value ); if( psz_value ) media->psz_mux = strdup( psz_value );
} }
else if( strncmp( psz_cmd, "input" , 5) == 0 ) else if( !strcmp( psz_cmd, "input" ) )
{ {
char *input; char *input;
...@@ -939,7 +943,7 @@ static int vlm_MediaSetup( vlm_t *vlm, vlm_media_t *media, char *psz_cmd, ...@@ -939,7 +943,7 @@ static int vlm_MediaSetup( vlm_t *vlm, vlm_media_t *media, char *psz_cmd,
TAB_APPEND( media->i_input, media->input, input ); TAB_APPEND( media->i_input, media->input, input );
} }
else if( strncmp( psz_cmd, "output", 6 ) == 0 ) else if( !strcmp( psz_cmd, "output" ) )
{ {
if( media->psz_output != NULL ) if( media->psz_output != NULL )
{ {
...@@ -947,7 +951,7 @@ static int vlm_MediaSetup( vlm_t *vlm, vlm_media_t *media, char *psz_cmd, ...@@ -947,7 +951,7 @@ static int vlm_MediaSetup( vlm_t *vlm, vlm_media_t *media, char *psz_cmd,
} }
media->psz_output = strdup( psz_value ); media->psz_output = strdup( psz_value );
} }
else if( strncmp( psz_cmd, "option", 6 ) == 0 ) else if( !strcmp( psz_cmd, "option" ) )
{ {
char *psz_option; char *psz_option;
psz_option = strdup( psz_value ); psz_option = strdup( psz_value );
...@@ -1044,7 +1048,7 @@ static int vlm_MediaControl( vlm_t *vlm, vlm_media_t *media, char *psz_id, ...@@ -1044,7 +1048,7 @@ static int vlm_MediaControl( vlm_t *vlm, vlm_media_t *media, char *psz_id,
p_instance = vlm_MediaInstanceSearch( vlm, media, psz_id ); p_instance = vlm_MediaInstanceSearch( vlm, media, psz_id );
if( strncmp( psz_command, "play", 4 ) == 0 && !p_instance ) if( !strcmp( psz_command, "play" ) && !p_instance )
{ {
if( !media->b_enabled || media->i_input == 0 ) return 0; if( !media->b_enabled || media->i_input == 0 ) return 0;
...@@ -1111,7 +1115,7 @@ static int vlm_MediaControl( vlm_t *vlm, vlm_media_t *media, char *psz_id, ...@@ -1111,7 +1115,7 @@ static int vlm_MediaControl( vlm_t *vlm, vlm_media_t *media, char *psz_id,
if( !p_instance ) return VLC_EGENERIC; if( !p_instance ) return VLC_EGENERIC;
if( strncmp( psz_command, "seek", 4 ) == 0 ) if( !strcmp( psz_command, "seek" ) )
{ {
vlc_value_t val; vlc_value_t val;
float f_percentage; float f_percentage;
...@@ -1123,7 +1127,7 @@ static int vlm_MediaControl( vlm_t *vlm, vlm_media_t *media, char *psz_id, ...@@ -1123,7 +1127,7 @@ static int vlm_MediaControl( vlm_t *vlm, vlm_media_t *media, char *psz_id,
return VLC_SUCCESS; return VLC_SUCCESS;
} }
} }
else if( strncmp( psz_command, "stop", 4 ) == 0 ) else if( !strcmp( psz_command, "stop" ) )
{ {
TAB_REMOVE( media->i_instance, media->instance, p_instance ); TAB_REMOVE( media->i_instance, media->instance, p_instance );
...@@ -1141,7 +1145,7 @@ static int vlm_MediaControl( vlm_t *vlm, vlm_media_t *media, char *psz_id, ...@@ -1141,7 +1145,7 @@ static int vlm_MediaControl( vlm_t *vlm, vlm_media_t *media, char *psz_id,
return VLC_SUCCESS; return VLC_SUCCESS;
} }
else if( strncmp( psz_command, "pause", 5 ) == 0 ) else if( !strcmp( psz_command, "pause" ) )
{ {
vlc_value_t val; vlc_value_t val;
...@@ -1222,16 +1226,16 @@ static vlm_schedule_t *vlm_ScheduleSearch( vlm_t *vlm, char *psz_name ) ...@@ -1222,16 +1226,16 @@ static vlm_schedule_t *vlm_ScheduleSearch( vlm_t *vlm, char *psz_name )
static int vlm_ScheduleSetup( vlm_schedule_t *schedule, char *psz_cmd, static int vlm_ScheduleSetup( vlm_schedule_t *schedule, char *psz_cmd,
char *psz_value ) char *psz_value )
{ {
if( strncmp( psz_cmd, "enabled", 7 ) == 0 ) if( !strcmp( psz_cmd, "enabled" ) )
{ {
schedule->b_enabled = VLC_TRUE; schedule->b_enabled = VLC_TRUE;
} }
else if( strncmp( psz_cmd, "disabled", 8 ) == 0 ) else if( !strcmp( psz_cmd, "disabled" ) )
{ {
schedule->b_enabled = VLC_FALSE; schedule->b_enabled = VLC_FALSE;
} }
#if !defined( UNDER_CE ) #if !defined( UNDER_CE )
else if( strncmp( psz_cmd, "date", 4 ) == 0 ) else if( !strcmp( psz_cmd, "date" ) )
{ {
struct tm time; struct tm time;
char *p; char *p;
...@@ -1250,7 +1254,7 @@ static int vlm_ScheduleSetup( vlm_schedule_t *schedule, char *psz_cmd, ...@@ -1250,7 +1254,7 @@ static int vlm_ScheduleSetup( vlm_schedule_t *schedule, char *psz_cmd,
/* date should be year/month/day-hour:minutes:seconds */ /* date should be year/month/day-hour:minutes:seconds */
p = strchr( psz_value, '-' ); p = strchr( psz_value, '-' );
if( strncmp( psz_value, "now", 3 ) == 0 ) if( !strcmp( psz_value, "now" ) )
{ {
schedule->i_date = 0; schedule->i_date = 0;
} }
...@@ -1304,7 +1308,7 @@ static int vlm_ScheduleSetup( vlm_schedule_t *schedule, char *psz_cmd, ...@@ -1304,7 +1308,7 @@ static int vlm_ScheduleSetup( vlm_schedule_t *schedule, char *psz_cmd,
schedule->i_date = ((mtime_t) date) * 1000000; schedule->i_date = ((mtime_t) date) * 1000000;
} }
} }
else if( strncmp( psz_cmd, "period" , 6) == 0 ) else if( !strcmp( psz_cmd, "period" ) )
{ {
struct tm time; struct tm time;
char *p; char *p;
...@@ -1383,7 +1387,7 @@ static int vlm_ScheduleSetup( vlm_schedule_t *schedule, char *psz_cmd, ...@@ -1383,7 +1387,7 @@ static int vlm_ScheduleSetup( vlm_schedule_t *schedule, char *psz_cmd,
schedule->i_period = ((mtime_t) date) * 1000000; schedule->i_period = ((mtime_t) date) * 1000000;
} }
#endif /* UNDER_CE */ #endif /* UNDER_CE */
else if( strncmp( psz_cmd, "repeat", 6 ) == 0 ) else if( !strcmp( psz_cmd, "repeat" ) )
{ {
int i; int i;
...@@ -1396,7 +1400,7 @@ static int vlm_ScheduleSetup( vlm_schedule_t *schedule, char *psz_cmd, ...@@ -1396,7 +1400,7 @@ static int vlm_ScheduleSetup( vlm_schedule_t *schedule, char *psz_cmd,
return 1; return 1;
} }
} }
else if( strncmp( psz_cmd, "append" , 6) == 0 ) else if( !strcmp( psz_cmd, "append" ) )
{ {
char *command = strdup( psz_value ); char *command = strdup( psz_value );
...@@ -1608,7 +1612,7 @@ static vlm_message_t *vlm_Show( vlm_t *vlm, vlm_media_t *media, ...@@ -1608,7 +1612,7 @@ static vlm_message_t *vlm_Show( vlm_t *vlm, vlm_media_t *media,
i_time = i_time / 12; i_time = i_time / 12;
date.tm_year = (int)i_time; date.tm_year = (int)i_time;
snprintf( buffer, 30,"%d/%d/%d-%d:%d:%d", date.tm_year, date.tm_mon, sprintf( buffer, "%d/%d/%d-%d:%d:%d", date.tm_year, date.tm_mon,
date.tm_mday, date.tm_hour, date.tm_min, date.tm_sec); date.tm_mday, date.tm_hour, date.tm_min, date.tm_sec);
vlm_MessageAdd( msg_schedule, vlm_MessageNew("period", buffer) ); vlm_MessageAdd( msg_schedule, vlm_MessageNew("period", buffer) );
...@@ -1635,7 +1639,7 @@ static vlm_message_t *vlm_Show( vlm_t *vlm, vlm_media_t *media, ...@@ -1635,7 +1639,7 @@ static vlm_message_t *vlm_Show( vlm_t *vlm, vlm_media_t *media,
} }
else if( psz_filter && strncmp( psz_filter, "media" , 5) == 0 ) else if( psz_filter && !strcmp( psz_filter, "media" ) )
{ {
int i, j; int i, j;
vlm_message_t *msg; vlm_message_t *msg;
...@@ -1687,7 +1691,7 @@ static vlm_message_t *vlm_Show( vlm_t *vlm, vlm_media_t *media, ...@@ -1687,7 +1691,7 @@ static vlm_message_t *vlm_Show( vlm_t *vlm, vlm_media_t *media,
return msg; return msg;
} }
else if( psz_filter && strncmp( psz_filter, "schedule", 8) == 0 ) else if( psz_filter && !strcmp( psz_filter, "schedule" ) )
{ {
int i; int i;
vlm_message_t *msg; vlm_message_t *msg;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment