* $Header$
*
* Copyright (C) 1987 by the Massachusetts Institute of Technology
+ * For copying and distribution information, please see the file
+ * <mit-copyright.h>.
*
* Miscellaneous string functions.
*/
static char *rcsid_strs_c = "$Header$";
#endif lint
+#include <mit-copyright.h>
#include <sys/types.h>
#include <strings.h>
#include <ctype.h>
/*
* Trim whitespace off both ends of a string.
*/
-char *strtrim(s)
- register char *s;
+char *strtrim(save)
+ register char *save;
{
- register char *t;
-
+ register char *t, *s;
+
+ s = save;
while (isspace(*s)) s++;
/* skip to end of string */
+ if (*s == '\0') {
+ *save = '\0';
+ return(save);
+ }
for (t = s; *t; t++) continue;
while (t > s) {