[MPlayer-cvslog] r32940 - trunk/gui/skin/skin.c

Reimar Döffinger Reimar.Doeffinger at gmx.de
Mon Feb 21 19:16:14 CET 2011


On Sun, Feb 20, 2011 at 01:42:30AM +0100, ib wrote:
> Author: ib
> Date: Sun Feb 20 01:42:29 2011
> New Revision: 32940
> 
> Log:
> Fix buggy strlower(). It's wrong to add 'A'.
> At the same time, simplify and optimize the function.
> 
> Modified:
>    trunk/gui/skin/skin.c
> 
> Modified: trunk/gui/skin/skin.c
> ==============================================================================
> --- trunk/gui/skin/skin.c	Sun Feb 20 01:04:19 2011	(r32939)
> +++ trunk/gui/skin/skin.c	Sun Feb 20 01:42:29 2011	(r32940)
> @@ -92,8 +92,12 @@ static void ERRORMESSAGE( const char * f
>  
>  static char * strlower( char * in )
>  {
> - int i;
> - for( i=0;i<(int)strlen( in );i++ ) in[i]=( in[i] >= 'A' ? ( in[i] <= 'Z' ?  in[i]+='A' : in[i] ) : in[i] );
> + char *p = in;
> + while (*p)
> +  {
> +   if (*p >= 'A' && *p <= 'Z') *p += ' ';

+= 'a' - 'A';
is easier to understand IMO.


More information about the MPlayer-cvslog mailing list