cppcheck warnings

This commit is contained in:
Shahram Najm 2022-10-17 20:54:37 +01:00
parent d61198ab65
commit ab69db609d
1 changed files with 3 additions and 2 deletions

View File

@ -161,11 +161,12 @@ static int execute(grib_action* act, grib_handle* h)
}
if (a->padtomultiple) {
char* zeros;
char* zeros = NULL;
size_t padding = a->padtomultiple - size % a->padtomultiple;
/* printf("XXX padding=%d size=%d padtomultiple=%d\n",padding,size,a->padtomultiple); */
zeros = (char*)calloc(padding, 1);
Assert(zeros);
if (!zeros)
return GRIB_OUT_OF_MEMORY;
if (fwrite(zeros, 1, padding, of->handle) != padding) {
grib_context_log(act->context, (GRIB_LOG_ERROR) | (GRIB_LOG_PERROR),
"Error writing to %s", filename);