Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpim-sw
libcdi
Commits
fea2ee64
Commit
fea2ee64
authored
Feb 11, 2011
by
Uwe Schulzweida
Browse files
cdfInqTimestep: check len of time string (wrf)
parent
d2640e0b
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/stream_cdf.c
View file @
fea2ee64
...
...
@@ -6336,11 +6336,13 @@ int cdfInqTimestep(int streamID, int tsID)
char
stvalue
[
32
];
start
[
0
]
=
index
;
start
[
1
]
=
0
;
count
[
0
]
=
1
;
count
[
1
]
=
19
;
stvalue
[
0
]
=
0
;
cdf_get_vara_text
(
fileID
,
nctimevarid
,
start
,
count
,
stvalue
);
stvalue
[
19
]
=
0
;
{
int
year
,
month
,
day
,
hour
,
minute
,
second
;
sscanf
(
stvalue
,
"%d-%d-%d_%d:%d:%d"
,
&
year
,
&
month
,
&
day
,
&
hour
,
&
minute
,
&
second
);
int
year
=
1
,
month
=
1
,
day
=
1
,
hour
=
0
,
minute
=
0
,
second
=
0
;
if
(
strlen
(
stvalue
)
==
19
)
sscanf
(
stvalue
,
"%d-%d-%d_%d:%d:%d"
,
&
year
,
&
month
,
&
day
,
&
hour
,
&
minute
,
&
second
);
taxis
->
vdate
=
cdiEncodeDate
(
year
,
month
,
day
);
taxis
->
vtime
=
cdiEncodeTime
(
hour
,
minute
,
second
);
taxis
->
type
=
TAXIS_ABSOLUTE
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment