Changeset 1232


Ignore:
Timestamp:
15/04/09 10:31:52 (3 years ago)
Author:
Freddie Akeroyd
Message:

Fix bug in NXXgetinfo for NX_CHAR. Refs #174.

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/nxio.c

    r1139 r1232  
    228228 actual stuff for implementing the callback functions 
    229229 =====================================================================*/ 
     230 
     231/* 
     232 * if passed NX_CHAR, then returns dimension of -1 and the caller 
     233 * needs to do a strlen() or equivalent  
     234 */ 
    230235void analyzeDim(const char *typeString, int *rank,  
    231236                            int *iDim, int *type){ 
     
    252257      break; 
    253258    case NX_CHAR: 
    254       iDim[0] = -1; 
     259      iDim[0] = -1;     /* length unknown, caller needs to determine later */ 
    255260      break; 
    256261    default: 
  • trunk/src/nxxml.c

    r1171 r1232  
    939939      *iType = translateTypeCode(attr); 
    940940      analyzeDim(attr,rank,dimension,iType); 
     941      if (dimension[0] == -1) /* 1D strings are NX_CHAR not NX_CHAR[] so length will not be correct */ 
     942      { 
     943        dimension[0] = strlen(userData->value.opaque); 
     944      } 
     945       
    941946    } 
    942947  } else {  
Note: See TracChangeset for help on using the changeset viewer.