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
277007dd
Commit
277007dd
authored
Mar 10, 2014
by
Uwe Schulzweida
Browse files
cgribexDefParam: check validity of parameter number
parent
07a68777
Changes
3
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
277007dd
...
...
@@ -3,6 +3,10 @@
* Version 1.6.4 released
* using CGRIBEX library version 1.6.4
2014-03-10 Uwe Schulzweida
* cgribexDefParam: check validity of parameter number
2014-03-04 Uwe Schulzweida
* zaxisCreate: check number of levels
...
...
app/cdi.c
View file @
277007dd
...
...
@@ -319,7 +319,8 @@ void printShortinfo(int streamID, int vlistID, int vardis)
char
pstr
[
4
];
char
paramstr
[
32
];
printf
(
" File format: "
);
fprintf
(
stdout
,
" File format"
);
fprintf
(
stdout
,
" : "
);
printFiletype
(
streamID
,
vlistID
);
if
(
vardis
)
...
...
src/stream_cgribex.c
View file @
277007dd
...
...
@@ -1454,6 +1454,7 @@ static
void
cgribexDefParam
(
int
*
isec1
,
int
param
)
{
int
pdis
,
pcat
,
pnum
;
static
bool
lwarn_pdis
=
true
,
lwarn_pnum
=
true
;
cdiDecodeParam
(
param
,
&
pnum
,
&
pcat
,
&
pdis
);
...
...
@@ -1463,7 +1464,21 @@ void cgribexDefParam(int *isec1, int param)
{
char
paramstr
[
32
];
cdiParamToString
(
param
,
paramstr
,
sizeof
(
paramstr
));
Warning
(
"Can't convert GRIB2 parameter ID (%s) to GRIB1, set to %d.%d!"
,
paramstr
,
pnum
,
pcat
);
if
(
lwarn_pdis
)
{
Warning
(
"Can't convert GRIB2 parameter ID (%s) to GRIB1, set to %d.%d!"
,
paramstr
,
pnum
,
pcat
);
lwarn_pdis
=
false
;
}
}
if
(
pnum
>
255
)
{
if
(
lwarn_pnum
)
{
Warning
(
"Parameter number %d out of bounds (1-255), set to %d!"
,
pnum
,
pnum
%
256
);
lwarn_pnum
=
false
;
pnum
=
pnum
%
256
;
}
}
ISEC1_CodeTable
=
pcat
;
...
...
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