Skip to content

Fixed string handling in attribute arrays looks fishy #386

@PeterC-DLS

Description

@PeterC-DLS

Lines 2521-9 are:

    tclass = H5Tget_class(datatype);
    /* stop gap kludge for fixed length strings */
    if (tclass == H5T_C_S1) {
        int datalen; /* fishy - uninitialised */
        status = readStringAttributeN(pFile->iCurrentA, data, datalen);
        if (status < 0)
            return NX_ERROR;
        return NX_OK;
    } 

I think the equality test should be tclass == HDF5Constants.H5T_STRING and then you check datatype to see if it is a variable length type.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions