mirror of https://github.com/ecmwf/eccodes.git
Compiler warnings: -Wformat-overflow
This commit is contained in:
parent
d5f43831a7
commit
aaf513ff55
|
@ -205,7 +205,7 @@ static int build_long_array(grib_context* c, grib_handle* h, int compressed,
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* uncompressed */
|
/* uncompressed */
|
||||||
char keystr[20] = {0,};
|
char keystr[32] = {0,};
|
||||||
size_t values_len = 0;
|
size_t values_len = 0;
|
||||||
for (i = 0; i < numberOfSubsets; ++i) {
|
for (i = 0; i < numberOfSubsets; ++i) {
|
||||||
long lVal = 0;
|
long lVal = 0;
|
||||||
|
@ -243,12 +243,12 @@ static int select_datetime(grib_accessor* a)
|
||||||
grib_iarray* subsets;
|
grib_iarray* subsets;
|
||||||
long* subsets_ar = 0;
|
long* subsets_ar = 0;
|
||||||
size_t nsubsets = 0;
|
size_t nsubsets = 0;
|
||||||
char yearstr[20] = "year";
|
char yearstr[32] = "year";
|
||||||
char monthstr[20] = "month";
|
char monthstr[32] = "month";
|
||||||
char daystr[20] = "day";
|
char daystr[32] = "day";
|
||||||
char hourstr[20] = "hour";
|
char hourstr[32] = "hour";
|
||||||
char minutestr[20] = "minute";
|
char minutestr[32] = "minute";
|
||||||
char secondstr[20] = "second";
|
char secondstr[32] = "second";
|
||||||
|
|
||||||
ret = grib_get_long(h, "compressedData", &compressed);
|
ret = grib_get_long(h, "compressedData", &compressed);
|
||||||
if (ret)
|
if (ret)
|
||||||
|
|
|
@ -997,8 +997,8 @@ grib_index* grib_index_read(grib_context* c, const char* filename, int* err)
|
||||||
int grib_index_search_same(grib_index* index, grib_handle* h)
|
int grib_index_search_same(grib_index* index, grib_handle* h)
|
||||||
{
|
{
|
||||||
int err = 0;
|
int err = 0;
|
||||||
char buf[1024] = {0,};
|
char buf[STRING_VALUE_LEN] = {0,};
|
||||||
size_t buflen = 1024;
|
size_t buflen = STRING_VALUE_LEN;
|
||||||
grib_index_key* keys;
|
grib_index_key* keys;
|
||||||
long lval = 0;
|
long lval = 0;
|
||||||
double dval = 0.0;
|
double dval = 0.0;
|
||||||
|
@ -1016,7 +1016,7 @@ int grib_index_search_same(grib_index* index, grib_handle* h)
|
||||||
if (err)
|
if (err)
|
||||||
keys->type = GRIB_TYPE_STRING;
|
keys->type = GRIB_TYPE_STRING;
|
||||||
}
|
}
|
||||||
buflen = 1024;
|
buflen = STRING_VALUE_LEN;
|
||||||
switch (keys->type) {
|
switch (keys->type) {
|
||||||
case GRIB_TYPE_STRING:
|
case GRIB_TYPE_STRING:
|
||||||
err = grib_get_string(h, keys->name, buf, &buflen);
|
err = grib_get_string(h, keys->name, buf, &buflen);
|
||||||
|
|
Loading…
Reference in New Issue