updated top-level README and version_decl for V4.4.2 (#1795)
[WRF.git] / external / io_grib1 / trim.c
blobcb219ad645c6d5d154c4880e5dc979e077347bd5
1 #include <stdio.h>
2 #include <stdlib.h>
4 char *trim (char *str)
6 char *ibuf, *obuf;
8 if (str)
10 for (ibuf = obuf = str; *ibuf; )
12 while (*ibuf && (isspace (*ibuf)))
13 ibuf++;
14 if (*ibuf && (obuf != str))
15 *(obuf++) = ' ';
16 while (*ibuf && (!isspace (*ibuf)))
17 *(obuf++) = *(ibuf++);
19 *obuf = '\0';
21 return (str);