[vlc-devel] [PATCH] Introducing Intelligent Approximate playlist search
Rémi Denis-Courmont
remi at remlab.net
Mon Mar 25 22:34:19 CET 2013
Le samedi 23 mars 2013 18:08:01, Abhiram Ravi a écrit :
> +static int levenshtein_distance ( const char* psz_str_1, const char*
> psz_str_2 )
> +{
> + // Duplicate, convert the strings to lower case
> + char* psz_1 = xstrdup ( psz_str_1 );
> + char* psz_2 = xstrdup ( psz_str_2 );
> + uint32_t cph;
> + ssize_t s;
> + for ( char *p = psz_1; *p; ++p )
> + {
> + s = vlc_towc ( p, &cph );
> + if ( s <= 0 ) continue;
> + *p = towlower ( cph );
You can't store a code point in a byte. Seriously, you need to test your code
with non-ASCII text.
--
Rémi Denis-Courmont
http://www.remlab.net/
More information about the vlc-devel
mailing list