summary refs log tree commit diff stats
path: root/plugins/mpcinfo/theme.c
diff options
context:
space:
mode:
authorArnavion <arnavion@gmail.com>2014-12-04 04:06:38 -0800
committerArnavion <arnavion@gmail.com>2014-12-04 04:06:38 -0800
commit8062bce835681d8200666ad183fe8cf3f6d87468 (patch)
treee81450df3b1b71d763695c9832edb3ffca265255 /plugins/mpcinfo/theme.c
parent3fbe5b876e3af3fde135eb42bcd3050b41865d1a (diff)
Fix some obvious type warnings.
Diffstat (limited to 'plugins/mpcinfo/theme.c')
-rw-r--r--plugins/mpcinfo/theme.c44
1 files changed, 26 insertions, 18 deletions
diff --git a/plugins/mpcinfo/theme.c b/plugins/mpcinfo/theme.c
index 3f98a59c..3d8a7a0e 100644
--- a/plugins/mpcinfo/theme.c
+++ b/plugins/mpcinfo/theme.c
@@ -49,24 +49,32 @@ void printThemes(){
      hexchat_printf(ph,"\nTitle-Theme:\n");printTheme(titleTheme);
 }
 
-void cbFix(char *line){
-     //if (DEBUG==1) putlog("cbfix");
-     int i, j;
-     for (i=0;i<strlen(line);i++){
-         if (line[i]=='%'){
-            if ((line[i+1]=='C')||(line[i+1]=='B')||(line[i+1]=='U')||(line[i+1]=='O')||(line[i+1]=='R')){
-               if(line[i+1]=='C') line[i]=3;
-               if(line[i+1]=='B') line[i]=2;
-               if(line[i+1]=='U') line[i]=37;
-               if(line[i+1]=='O') line[i]=17;
-               if(line[i+1]=='R') line[i]=26;
-
-               for (j=i+1;j<strlen(line)-1;j++) line[j]=line[j+1];
-               line[strlen(line)-1]=0;
-            }
-         }
-     }
-     //if (DEBUG==1) putlog("cbfix done");
+void cbFix(char *line)
+{
+	size_t i;
+	for (i = 0; i < strlen(line); i++)
+	{
+		size_t j;
+
+		if (line[i] == '%')
+		{
+			if ((line[i + 1] == 'C') || (line[i + 1] == 'B') || (line[i + 1] == 'U') || (line[i + 1] == 'O') || (line[i + 1] == 'R'))
+			{
+				if (line[i + 1] == 'C') line[i] = 3;
+				if (line[i + 1] == 'B') line[i] = 2;
+				if (line[i + 1] == 'U') line[i] = 37;
+				if (line[i + 1] == 'O') line[i] = 17;
+				if (line[i + 1] == 'R') line[i] = 26;
+
+				for (j = i + 1; j < strlen(line) - 1; j++)
+				{
+					line[j] = line[j + 1];
+				}
+
+				line[strlen(line) - 1] = 0;
+			}
+		}
+	}
 }
 
 struct theme themeAdd(struct theme data, char *info){