* Remove leading and trailing whitespace */
| 120 | * Remove leading and trailing whitespace |
| 121 | */ |
| 122 | char *dStrstrip(char *s) |
| 123 | { |
| 124 | char *p; |
| 125 | int len; |
| 126 | |
| 127 | if (s && *s) { |
| 128 | for (p = s; dIsspace(*p); ++p); |
| 129 | for (len = strlen(p); len && dIsspace(p[len-1]); --len); |
| 130 | if (p > s) |
| 131 | memmove(s, p, len); |
| 132 | s[len] = 0; |
| 133 | } |
| 134 | return s; |
| 135 | } |
| 136 | |
| 137 | /** |
| 138 | * Clear the contents of the string |
no outgoing calls
no test coverage detected