Changeset 5ebff60 for protocols/oscar/oscar_util.c
- Timestamp:
- 2015-02-20T22:50:54Z (9 years ago)
- Branches:
- master
- Children:
- 0b9daac, 3d45471, 7733b8c
- Parents:
- af359b4
- git-author:
- Indent <please@…> (19-02-15 05:47:20)
- git-committer:
- dequis <dx@…> (20-02-15 22:50:54)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/oscar/oscar_util.c
raf359b4 r5ebff60 4 4 /* 5 5 * int snlen(const char *) 6 * 6 * 7 7 * This takes a screen name and returns its length without 8 * spaces. If there are no spaces in the SN, then the 8 * spaces. If there are no spaces in the SN, then the 9 9 * return is equal to that of strlen(). 10 10 * … … 15 15 const char *curPtr = NULL; 16 16 17 if (!sn) 17 if (!sn) { 18 18 return 0; 19 } 19 20 20 21 curPtr = sn; 21 while ( (*curPtr) != (char) '\0') { 22 if ((*curPtr) != ' ') 23 i++; 22 while ((*curPtr) != (char) '\0') { 23 if ((*curPtr) != ' ') { 24 i++; 25 } 24 26 curPtr++; 25 27 } … … 45 47 const char *curPtr1 = NULL, *curPtr2 = NULL; 46 48 47 if (aim_snlen(sn1) != aim_snlen(sn2)) 49 if (aim_snlen(sn1) != aim_snlen(sn2)) { 48 50 return 1; 51 } 49 52 50 53 curPtr1 = sn1; 51 54 curPtr2 = sn2; 52 while ( (*curPtr1 != (char) '\0') && (*curPtr2 != (char) '\0')) {53 if ( (*curPtr1 == ' ') || (*curPtr2 == ' ')) {54 if (*curPtr1 == ' ') 55 while ((*curPtr1 != (char) '\0') && (*curPtr2 != (char) '\0')) { 56 if ((*curPtr1 == ' ') || (*curPtr2 == ' ')) { 57 if (*curPtr1 == ' ') { 55 58 curPtr1++; 56 if (*curPtr2 == ' ') 59 } 60 if (*curPtr2 == ' ') { 57 61 curPtr2++; 62 } 58 63 } else { 59 if ( g_ascii_toupper(*curPtr1) != g_ascii_toupper(*curPtr2))64 if (g_ascii_toupper(*curPtr1) != g_ascii_toupper(*curPtr2)) { 60 65 return 1; 66 } 61 67 curPtr1++; 62 68 curPtr2++; … … 65 71 66 72 /* Should both be NULL */ 67 if (*curPtr1 != *curPtr2) 73 if (*curPtr1 != *curPtr2) { 68 74 return 1; 75 } 69 76 70 77 return 0;
Note: See TracChangeset
for help on using the changeset viewer.