IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 916


Ignore:
Timestamp:
Jun 7, 2004, 4:39:42 PM (22 years ago)
Author:
desonia
Message:

allowed psDlistToVector to create an empty vector from an empty list.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/collections/psDlist.c

    r912 r916  
    66 *  @author Robert Daniel DeSonia, MHPCC
    77 *
    8  *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2004-06-08 02:18:15 $
     8 *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2004-06-08 02:39:42 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    420420    psDlistElem* ptr;
    421421    unsigned int n;
     422    psVector* restrict arr;
    422423
    423424    if (dlist == NULL) {
     
    425426    }
    426427
    427     psVector* restrict arr = psVectorAlloc(dlist->size, PS_TYPE_PTR);
    428     arr->n = arr->nalloc;
     428    if (dlist->size > 0) {
     429        arr = psVectorAlloc(dlist->size, PS_TYPE_PTR);
     430    } else {
     431        arr = psVectorAlloc(1, PS_TYPE_PTR);
     432    }
     433
     434    arr->n = dlist->size;
     435
    429436
    430437    ptr = dlist->head;
Note: See TracChangeset for help on using the changeset viewer.