Update version info for release v4.6.1 (#2122)
[WRF.git] / external / io_grib1 / trim.c
blob3f06fbe4723894e135312ae72ecaab5b41c1b215
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <ctype.h>
5 char *trim (char *str)
7 char *ibuf, *obuf;
9 if (str)
11 for (ibuf = obuf = str; *ibuf; )
13 while (*ibuf && (isspace (*ibuf)))
14 ibuf++;
15 if (*ibuf && (obuf != str))
16 *(obuf++) = ' ';
17 while (*ibuf && (!isspace (*ibuf)))
18 *(obuf++) = *(ibuf++);
20 *obuf = '\0';
22 return (str);