Changeset 1234


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

Merge back changes from 4.2 branch (add space for NULL termination)
Probably not needed now (issue #174 was properly fixed in r1232),
but no harm done. Refs #174.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/applications/nxconvert_common.c

    r1079 r1234  
    9494      return NX_ERROR; 
    9595   } 
    96     
     96 
    9797/* Output global attributes */ 
    9898   if (WriteAttributes (nx_is_definition) != NX_OK) 
     
    105105        return NX_ERROR; 
    106106   } 
    107 /* clos einput */ 
     107/* close input */ 
    108108   if (NXclose (&inId) != NX_OK) 
    109109   { 
  • trunk/src/nxdataset.c

    r952 r1234  
    4747    length *= dim[i]; 
    4848  } 
    49   pNew->u.ptr = malloc(length*getTypeSize(typecode)); 
     49  /* add +1 in case of string NULL termination */ 
     50  pNew->u.ptr = malloc(length*getTypeSize(typecode)+1); 
    5051 
    5152  if(pNew->dim == NULL || pNew->u.ptr == NULL){ 
     
    6061  } 
    6162  pNew->magic = MAGIC; 
    62   memset(pNew->u.ptr,0,length*getTypeSize(typecode)); 
     63  /* add +1 in case of string NULL termination  - see above */ 
     64  memset(pNew->u.ptr,0,length*getTypeSize(typecode)+1); 
    6365  return pNew; 
    6466} 
Note: See TracChangeset for help on using the changeset viewer.