]> code.citadel.org Git - citadel.git/blobdiff - citadel/client_chat.c
* strlen holy war: loops. in loops it's very evil. the easy ones go away now.
[citadel.git] / citadel / client_chat.c
index 08eff91d854a83f283ca1899320badf04f147dce..535055fc9d40f7e8add4c2d70d57e1fcf3da4711 100644 (file)
@@ -113,7 +113,7 @@ void chatmode(CtdlIPC *ipc)
                        if ((ch == 10) || (ch == 13)) {
                                send_complete_line = 1;
                        } else if ((ch == 8) || (ch == 127)) {
-                               if (strlen(wbuf) > 0) {
+                               if (!IsEmptyStr(wbuf)) {
                                        wbuf[strlen(wbuf) - 1] = 0;
                                        sln_printf("%c %c", 8, 8);
                                }
@@ -135,7 +135,7 @@ RCL:                if (send_complete_line) {
                /* if it's time to word wrap, send a partial line */
                if (strlen(wbuf) >= (77 - strlen(fullname))) {
                        pos = 0;
-                       for (a = 0; a < strlen(wbuf); ++a) {
+                       for (a = 0; !IsEmptyStr(&wbuf[a]); ++a) {
                                if (wbuf[a] == 32)
                                        pos = a;
                        }