aboutsummaryrefslogtreecommitdiffstats
path: root/protocols/oscar/oscar_util.c
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/oscar/oscar_util.c')
-rw-r--r--protocols/oscar/oscar_util.c33
1 files changed, 20 insertions, 13 deletions
diff --git a/protocols/oscar/oscar_util.c b/protocols/oscar/oscar_util.c
index 806632ff..c2ce8e4d 100644
--- a/protocols/oscar/oscar_util.c
+++ b/protocols/oscar/oscar_util.c
@@ -3,9 +3,9 @@
/*
* int snlen(const char *)
-*
+*
* This takes a screen name and returns its length without
-* spaces. If there are no spaces in the SN, then the
+* spaces. If there are no spaces in the SN, then the
* return is equal to that of strlen().
*
*/
@@ -14,13 +14,15 @@ static int aim_snlen(const char *sn)
int i = 0;
const char *curPtr = NULL;
- if (!sn)
+ if (!sn) {
return 0;
+ }
curPtr = sn;
- while ( (*curPtr) != (char) '\0') {
- if ((*curPtr) != ' ')
- i++;
+ while ((*curPtr) != (char) '\0') {
+ if ((*curPtr) != ' ') {
+ i++;
+ }
curPtr++;
}
@@ -44,28 +46,33 @@ int aim_sncmp(const char *sn1, const char *sn2)
{
const char *curPtr1 = NULL, *curPtr2 = NULL;
- if (aim_snlen(sn1) != aim_snlen(sn2))
+ if (aim_snlen(sn1) != aim_snlen(sn2)) {
return 1;
+ }
curPtr1 = sn1;
curPtr2 = sn2;
- while ( (*curPtr1 != (char) '\0') && (*curPtr2 != (char) '\0') ) {
- if ( (*curPtr1 == ' ') || (*curPtr2 == ' ') ) {
- if (*curPtr1 == ' ')
+ while ((*curPtr1 != (char) '\0') && (*curPtr2 != (char) '\0')) {
+ if ((*curPtr1 == ' ') || (*curPtr2 == ' ')) {
+ if (*curPtr1 == ' ') {
curPtr1++;
- if (*curPtr2 == ' ')
+ }
+ if (*curPtr2 == ' ') {
curPtr2++;
+ }
} else {
- if ( g_ascii_toupper(*curPtr1) != g_ascii_toupper(*curPtr2))
+ if (g_ascii_toupper(*curPtr1) != g_ascii_toupper(*curPtr2)) {
return 1;
+ }
curPtr1++;
curPtr2++;
}
}
/* Should both be NULL */
- if (*curPtr1 != *curPtr2)
+ if (*curPtr1 != *curPtr2) {
return 1;
+ }
return 0;
}