added size check to constructor
authorerickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Mon, 7 May 2007 14:07:36 +0000 (14:07 +0000)
committererickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Mon, 7 May 2007 14:07:36 +0000 (14:07 +0000)
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@874 9efc2488-bf62-4759-914b-345cdb29e865

src/libstack/osrf_list.c

index 261e850..0054c79 100644 (file)
@@ -11,6 +11,7 @@ osrfList* osrfNewList() {
 osrfList* osrfNewListSize( unsigned int size ) {
        osrfList* list;
        OSRF_MALLOC(list, sizeof(osrfList));
+    if( size <= 0 ) size = 16;
        list->arrsize   = size;
        OSRF_MALLOC( list->arrlist, list->arrsize * sizeof(void*) );
        return list;