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
6a20d938
Commit
6a20d938
authored
May 07, 2008
by
Uwe Schulzweida
Browse files
No commit message
No commit message
parent
48448174
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/stream.c
View file @
6a20d938
...
...
@@ -1184,13 +1184,14 @@ void streamClose(int streamID)
stream_delete_entry
(
streamptr
);
if
(
vlistInqTaxis
(
vlistID
)
!=
-
1
)
{
taxisDestroy
(
vlistInqTaxis
(
vlistID
));
}
if
(
vlistID
!=
-
1
)
{
if
(
streamptr
->
filemode
!=
'w'
)
if
(
vlistInqTaxis
(
vlistID
)
!=
-
1
)
{
taxisDestroy
(
vlistInqTaxis
(
vlistID
));
}
vlistDestroy
(
vlistID
);
}
}
...
...
src/taxis.c
View file @
6a20d938
...
...
@@ -1033,6 +1033,7 @@ void splitTimevalue(double timevalue, int timeunit, int *date, int *time)
static
char
func
[]
=
"splitTimevalue"
;
int
vdate
=
0
,
vtime
=
0
;
int
hour
,
minute
;
int
year
,
month
,
day
;
if
(
timeunit
==
TUNIT_HOUR
)
{
...
...
@@ -1069,6 +1070,26 @@ void splitTimevalue(double timevalue, int timeunit, int *date, int *time)
Message
(
func
,
"Unsupported TIMEUNIT: %s!"
,
tunitNamePtr
(
timeunit
));
}
/* verify date and time */
decode_date
(
vdate
,
&
year
,
&
month
,
&
day
);
decode_time
(
vtime
,
&
hour
,
&
minute
);
if
(
month
>
17
||
day
>
31
||
hour
>
23
||
minute
>
59
)
{
if
(
(
month
>
17
||
day
>
31
)
&&
(
year
<
-
9999
||
year
>
9999
)
)
year
=
1
;
if
(
month
>
17
)
month
=
1
;
if
(
day
>
31
)
day
=
1
;
if
(
hour
>
23
)
hour
=
0
;
if
(
minute
>
59
)
minute
=
0
;
vdate
=
encode_date
(
year
,
month
,
day
);
vtime
=
encode_time
(
hour
,
minute
);
Warning
(
func
,
"Reset wrong date/time to %4.4d-%2.2d-%2.2d %2.2d:%2.2d!"
,
year
,
month
,
day
,
hour
,
minute
);
}
*
date
=
vdate
;
*
time
=
vtime
;
}
...
...
Write
Preview
Markdown
is supported
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