* Bugfixes
[citadel.git] / citadel / tools.c
index 3a457ae6efc072a71c87bfa325699e6049df0bd0..21c1ce91eaef46358cad439e41c3d2bfb92d872f 100644 (file)
@@ -388,7 +388,7 @@ void striplt(char *buf)
 {
         while ((strlen(buf) > 0) && (isspace(buf[0])))
                 strcpy(buf, &buf[1]);
-        while (isspace(buf[strlen(buf) - 1]))
+        while ((strlen(buf) > 0) && (isspace(buf[strlen(buf) - 1])))
                 buf[strlen(buf) - 1] = 0;
 }