return(buf);
}
-
-/*
- * Strip leading/tailing characters from null terminated str and return a
- * pointer to the new string.
- */
-
-char *clean(char *str)
-{
- size_t i;
- /* Position of last non space. */
- int ln;
- /* Position of first non space. */
- int fn;
- int gf;
-
- ln = 0;
- fn = 0;
- gf = 0;
-
- /* Dont need to deal with 1 character */
- if (strlen(str) <= 1)
- return str;
-
- for (i = 0; i < strlen(str); i++)
- {
- if (fn == 0 && str[i] != ' ' && !gf)
- {
- fn = i;
- gf = 1;
- }
- if (str[i] != ' ')
- ln = i;
- }
-
- /* Null terminate before the tailing spaces. */
- str[ln + 1] = 0;
-
- /* Return pointer to point after leading spaces. */
- return(str + (fn));
-}
#define MISC_H
extern char *dissect_time(time_t);
-extern char *clean(char *);
#endif