We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 94ce438 commit a77e149Copy full SHA for a77e149
1 file changed
src/drivers/ncmpio/ncmpio_header_put.c
@@ -220,9 +220,11 @@ hdr_put_NC_attr(bufferinfo *pbp,
220
status = ncmpix_put_uint64((void**)(&pbp->pos), (uint64)attrp->nelems);
221
if (status != NC_NOERR) return status;
222
223
- /* copy [values ...] */
224
- status = hdr_put_NC_attrV(pbp, attrp);
225
- if (status != NC_NOERR) return status;
+ if (attrp->nelems > 0) { /* attribute is allowed to be of size zero */
+ /* copy [values ...] */
+ status = hdr_put_NC_attrV(pbp, attrp);
226
+ if (status != NC_NOERR) return status;
227
+ }
228
229
return NC_NOERR;
230
}
0 commit comments