comparison libpurple/protocols/zephyr/zephyr.c @ 31905:323876c34a96

Don't use strlen() when all you're trying to do is check if the string is empty
author Mark Doliner <mark@kingant.net>
date Mon, 22 Aug 2011 02:07:41 +0000
parents 3322201b446f
children e8d4755ef84b
comparison
equal deleted inserted replaced
31904:3322201b446f 31905:323876c34a96
2083 { 2083 {
2084 int pos = 0; 2084 int pos = 0;
2085 int pos2 = 0; 2085 int pos2 = 0;
2086 char *newmsg; 2086 char *newmsg;
2087 2087
2088 if (message && (strlen(message) > 0)) { 2088 if (message && *message) {
2089 newmsg = g_new0(char,1+strlen(message)*2); 2089 newmsg = g_new0(char,1+strlen(message)*2);
2090 while(pos < strlen(message)) { 2090 while(pos < strlen(message)) {
2091 if (message[pos]=='\\') { 2091 if (message[pos]=='\\') {
2092 newmsg[pos2]='\\'; 2092 newmsg[pos2]='\\';
2093 newmsg[pos2+1]='\\'; 2093 newmsg[pos2+1]='\\';
2115 { 2115 {
2116 int pos = 0; 2116 int pos = 0;
2117 int pos2 = 0; 2117 int pos2 = 0;
2118 char *newmsg; 2118 char *newmsg;
2119 2119
2120 if (message && (strlen(message) > 0)) { 2120 if (message && *message) {
2121 newmsg = g_new0(char,strlen(message)+1); 2121 newmsg = g_new0(char,strlen(message)+1);
2122 while(pos < strlen(message)) { 2122 while(pos < strlen(message)) {
2123 if (message[pos]=='\\') { 2123 if (message[pos]=='\\') {
2124 pos++; 2124 pos++;
2125 } 2125 }