Commit fb3c1a28 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

LUA: (really) fix infinite loop

parent d710b22a
......@@ -83,15 +83,17 @@ static const struct
static const char *WordInList( const char *psz_list, const char *psz_word )
{
size_t i_len = strlen( psz_word );
for( const char *s = psz_list; s; s = strchr( s, ',' ) )
for( ;; )
{
if( !strncmp( s, psz_word, i_len )
&& memchr( ",", s[i_len], 2 ) )
return s;
const char *end = strchr( psz_list, ',' );
if( end == NULL )
break;
if( !strncmp( psz_list, psz_word, end - psz_list ) )
return psz_list;
psz_list = end + 1;
}
return NULL;
return strcmp( psz_list, psz_word ) ? psz_list : NULL;
}
static char *GetModuleName( intf_thread_t *p_intf )
......
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