Skip to content

Commit

Permalink
Fix new LGTM errors
Browse files Browse the repository at this point in the history
  • Loading branch information
DennisHeimbigner committed Mar 14, 2022
1 parent 092c395 commit 150e19c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
5 changes: 3 additions & 2 deletions libnczarr/zfilter.c
Original file line number Diff line number Diff line change
Expand Up @@ -1508,15 +1508,16 @@ memset(plugin,0,sizeof(NCZ_Plugin));
static int
pluginnamecheck(const char* name)
{
size_t i,count,len;
size_t count,len;
long i;
const char* p;
if(name == NULL) return 0;
/* get basename */
p = strrchr(name,'/');
if(p != NULL) name = (p+1);
len = strlen(name);
if(len == 0) return 0;
i = len-1;
i = (long)(len-1);
count = 1;
p = name+i;
for(;i>=0;i--,count++,p--) {
Expand Down
14 changes: 7 additions & 7 deletions ncdump/ncfilteravail.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ getformat(const char* sformat)


static int
makeurl(struct Options* faoptions)
makeurl(struct Options* faopt)
{
int stat = NC_NOERR;
int format;
Expand All @@ -101,7 +101,7 @@ makeurl(struct Options* faoptions)
#else
pid = (int)getpid();
#endif
switch (format = getformat(faoptions->format)) {
switch (format = getformat(faopt->format)) {
case NC_FORMATX_NC4:
snprintf(url,sizeof(url),"tmp_%d.nc",pid);
break;
Expand All @@ -110,23 +110,23 @@ makeurl(struct Options* faoptions)
break;
default: stat = NC_EINVAL; break;
}
if(stat == NC_NOERR) faoptions->url = strdup(url);
if(stat == NC_NOERR) faopt->url = strdup(url);
return stat;
}

static int
makefilterid(struct Options* faoptions)
makefilterid(struct Options* faopt)
{
int stat = NC_NOERR;
const struct Filter* f = NULL;
for(f=known_filters;f->name;f++) {
if(strcmp(f->name,faoptions->filtername)==0) {
faoptions->filterid = f->id;
if(strcmp(f->name,faopt->filtername)==0) {
faopt->filterid = f->id;
goto done;
}
}
/* See if it is a number */
if(1!=sscanf(faoptions->filtername,"%u",&faoptions->filterid))
if(1!=sscanf(faopt->filtername,"%u",&faopt->filterid))
{stat = NC_EINVAL; goto done;}
done:
return stat;
Expand Down
2 changes: 1 addition & 1 deletion plugins/H5Zblosc.c
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ NCZ_blosc_modify_parameters(int ncid, int varid, size_t* vnparamsp, unsigned** v
{stat = NC_EFILTER; goto done;}
nparams = 7;

if(vnparams > 0 && vparams == NULL)
if(vparams == NULL)
{stat = NC_EFILTER; goto done;}

if(wnparamsp == NULL || wparamsp == NULL)
Expand Down

0 comments on commit 150e19c

Please sign in to comment.