*/
void striplt(char *buf)
{
- if (strlen(buf) == 0) return;
- while ((strlen(buf) > 0) && (isspace(buf[0])))
- strcpy(buf, &buf[1]);
- if (strlen(buf) == 0) return;
- while (isspace(buf[strlen(buf) - 1]))
- buf[strlen(buf) - 1] = 0;
+ long len;
+
+ len = strlen(buf);
+ if (len == 0) return;
+ while ((len > 0) && (isspace(buf[0]))){
+ memmove (buf, &buf[1], len);
+ len --;
+ }
+ if (len == 0) return;
+ while (isspace(buf[len - 1])){
+ buf[len - 1] = 0;
+ len --;
+ }
}