Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv26909/src
Modified Files:
common.h
Log Message:
allow LIST_append() to work on empty lists
Index: common.h
===================================================================
RCS file: /cvsroot/srvx/services/src/common.h,v
retrieving revision 1.90
retrieving revision 1.91
diff -C2 -r1.90 -r1.91
*** common.h 3 Aug 2003 03:01:23 -0000 1.90
--- common.h 3 Aug 2003 14:40:24 -0000 1.91
***************
*** 143,147 ****
void STRUCTNAME##_append(struct STRUCTNAME *list, ITEMTYPE new_item) {\
if (list->used == list->size) {\
! list->size <<= 1;\
list->list = realloc(list->list, list->size*sizeof(list->list[0]));\
}\
--- 143,147 ----
void STRUCTNAME##_append(struct STRUCTNAME *list, ITEMTYPE new_item) {\
if (list->used == list->size) {\
! list->size = list->size ? (list->size << 1) : 4;\
list->list = realloc(list->list, list->size*sizeof(list->list[0]));\
}\
|