Last change
on this file since 354 was
1,
checked in by lfita, 10 years ago
|
- -- --- Opening of the WRF+LMDZ coupling repository --- -- -
WRF: version v3.3
LMDZ: version v1818
More details in:
|
File size:
517 bytes
|
Line | |
---|
1 | #include <stdio.h> |
---|
2 | #include <stdlib.h> |
---|
3 | |
---|
4 | char *trim (char *str) |
---|
5 | { |
---|
6 | char *ibuf, *obuf; |
---|
7 | |
---|
8 | if (str) |
---|
9 | { |
---|
10 | for (ibuf = obuf = str; *ibuf; ) |
---|
11 | { |
---|
12 | while (*ibuf && (isspace (*ibuf))) |
---|
13 | ibuf++; |
---|
14 | if (*ibuf && (obuf != str)) |
---|
15 | *(obuf++) = ' '; |
---|
16 | while (*ibuf && (!isspace (*ibuf))) |
---|
17 | *(obuf++) = *(ibuf++); |
---|
18 | } |
---|
19 | *obuf = '\0'; |
---|
20 | } |
---|
21 | return (str); |
---|
22 | } |
---|
23 | |
---|
Note: See
TracBrowser
for help on using the repository browser.