repo.or.cz
/
WRF.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Update version info for release v4.6.1 (#2122)
[WRF.git]
/
external
/
io_grib1
/
trim.c
blob
3f06fbe4723894e135312ae72ecaab5b41c1b215
1
#include <stdio.h>
2
#include <stdlib.h>
3
#include <ctype.h>
4
5
char
*
trim
(
char
*
str
)
6
{
7
char
*
ibuf
, *
obuf
;
8
9
if
(
str
)
10
{
11
for
(
ibuf
=
obuf
=
str
; *
ibuf
; )
12
{
13
while
(*
ibuf
&& (
isspace
(*
ibuf
)))
14
ibuf
++;
15
if
(*
ibuf
&& (
obuf
!=
str
))
16
*(
obuf
++) =
' '
;
17
while
(*
ibuf
&& (!
isspace
(*
ibuf
)))
18
*(
obuf
++) = *(
ibuf
++);
19
}
20
*
obuf
=
'\0'
;
21
}
22
return
(
str
);
23
}
24