cppcheck warnings

This commit is contained in:
Shahram Najm 2019-11-05 18:20:46 +00:00
parent 097be89d67
commit 2eb3cdcd14
2 changed files with 2 additions and 1 deletions

View File

@ -320,6 +320,7 @@ static int unpack_string (grib_accessor* a, char* buffer, size_t *len)
} }
*len=rsize; *len=rsize;
Assert(buffer);
memcpy(buffer,start,rsize); memcpy(buffer,start,rsize);
buffer[rsize]=0; buffer[rsize]=0;

View File

@ -338,7 +338,7 @@ static int grib_load_smart_table(grib_context* c,const char* filename,
while(fgets(line,sizeof(line)-1,f)) while(fgets(line,sizeof(line)-1,f))
{ {
char* s=line; char* s=line;
char* p=line; char* p;
line[strlen(line)-1]=0; line[strlen(line)-1]=0;