Incorrect flag is set test for readonly

I think that if the flag `NC_WRITE` *is* set, then the file is not readonly.  I think that the test should be negated.
This commit is contained in:
Greg Sjaardema 2018-10-23 14:05:57 -06:00 committed by GitHub
parent 8d5e66ec5f
commit 5435bcbcda
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -446,7 +446,7 @@ memio_pad_length(ncio* nciop, off_t length)
if(nciop == NULL || nciop->pvt == NULL) return NC_EINVAL;
memio = (NCMEMIO*)nciop->pvt;
if(fIsSet(nciop->ioflags,NC_WRITE))
if(!fIsSet(nciop->ioflags,NC_WRITE))
return EPERM; /* attempt to write readonly file*/
if(memio->locked)
return NC_EINMEMORY;