changeset 32853:17f47c07d1f7

Fix buggy strlower(). It's wrong to add 'A'. At the same time, simplify and optimize the function.
author ib
date Sun, 20 Feb 2011 00:42:29 +0000
parents cc4db17f2d2c
children fc4fb1ff3f01
files gui/skin/skin.c
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/gui/skin/skin.c	Sun Feb 20 00:04:19 2011 +0000
+++ b/gui/skin/skin.c	Sun Feb 20 00:42:29 2011 +0000
@@ -92,8 +92,12 @@
 
 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 += ' ';
+   p++;
+  }
  return in;
 }