Skip to content
GitLab
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
45672ae9
Commit
45672ae9
authored
Jul 06, 2017
by
Uwe Schulzweida
Browse files
removed leading space from time units (bug fix).
parent
1698f3b0
Changes
3
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
45672ae9
...
...
@@ -3,6 +3,10 @@
* using CGRIBEX library version 1.8.1
* Version 1.9.0 released
2017-07-06 Uwe Schulzweida
* removed leading space from time units (bug fix)
2017-07-01 Uwe Schulzweida
* Added function tableInqEntry().
...
...
src/cdf_util.c
View file @
45672ae9
...
...
@@ -13,6 +13,7 @@ void str_tolower(char *str)
str
[
i
]
=
(
char
)
tolower
((
int
)
str
[
i
]);
}
bool
str_is_equal
(
const
char
*
vstr
,
const
char
*
cstr
)
{
bool
is_equal
=
false
;
...
...
@@ -27,6 +28,8 @@ int get_timeunit(size_t len, const char *ptu)
{
int
timeunit
=
-
1
;
while
(
isspace
(
*
ptu
)
&&
len
)
{
ptu
++
;
len
--
;
}
if
(
len
>
2
)
{
if
(
str_is_equal
(
ptu
,
"sec"
)
)
timeunit
=
TUNIT_SECOND
;
...
...
@@ -37,8 +40,7 @@ int get_timeunit(size_t len, const char *ptu)
else
if
(
str_is_equal
(
ptu
,
"calendar_month"
)
)
timeunit
=
TUNIT_MONTH
;
else
if
(
str_is_equal
(
ptu
,
"year"
)
)
timeunit
=
TUNIT_YEAR
;
}
else
if
(
len
==
1
&&
ptu
[
0
]
==
's'
)
timeunit
=
TUNIT_SECOND
;
else
if
(
len
==
1
&&
ptu
[
0
]
==
's'
)
timeunit
=
TUNIT_SECOND
;
return
timeunit
;
}
...
...
@@ -46,6 +48,8 @@ int get_timeunit(size_t len, const char *ptu)
bool
is_time_units
(
const
char
*
timeunits
)
{
while
(
isspace
(
*
timeunits
)
)
timeunits
++
;
bool
status
=
str_is_equal
(
timeunits
,
"sec"
)
||
str_is_equal
(
timeunits
,
"minute"
)
||
str_is_equal
(
timeunits
,
"hour"
)
...
...
src/stream_cdf_i.c
View file @
45672ae9
...
...
@@ -199,6 +199,8 @@ int setBaseTime(const char *timeunits, taxis_t *taxis)
int
rdate
=
-
1
,
rtime
=
-
1
;
size_t
len
=
strlen
(
timeunits
);
while
(
isspace
(
*
timeunits
)
&&
len
)
{
timeunits
++
;
len
--
;
}
char
*
restrict
tu
=
(
char
*
)
Malloc
((
len
+
1
)
*
sizeof
(
char
));
for
(
size_t
i
=
0
;
i
<
len
;
i
++
)
tu
[
i
]
=
(
char
)
tolower
((
int
)
timeunits
[
i
]);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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