* Holy war on strlen: use IsEmptyStr where apropriate.
[citadel.git] / citadel / tools.c
index 5f225ccbddc03e814a3a02bb53e1eade2f7150a7..af91ce78fb1d005ddbb40271620b92dcef313426 100644 (file)
@@ -377,11 +377,11 @@ char *rfc2047encode(char *line, long length)
  */
 void striplt(char *buf)
 {
-       if (strlen(buf) == 0) return;
-        while ((strlen(buf) > 0) && (isspace(buf[0])))
+       if (IsEmptyStr(buf)) return;
+        while ((!IsEmptyStr(buf)) && (isspace(buf[0])))
                 strcpy(buf, &buf[1]);
-       if (strlen(buf) == 0) return;
-        while ((strlen(buf) > 0) && (isspace(buf[strlen(buf) - 1])))
+       if (IsEmptyStr(buf)) return;
+        while ((!IsEmptyStr(buf)) && (isspace(buf[strlen(buf) - 1])))
                 buf[strlen(buf) - 1] = 0;
 }