--- libaitio/src/Attic/vars.c 2011/11/03 14:56:48 1.2.2.3 +++ libaitio/src/Attic/vars.c 2011/12/13 02:22:05 1.2.2.6 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: vars.c,v 1.2.2.3 2011/11/03 14:56:48 misho Exp $ +* $Id: vars.c,v 1.2.2.6 2011/12/13 02:22:05 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -429,7 +429,7 @@ io_map2vars(u_char *buf, int buflen, int vnum, int zcp * return: =NULL error or !=NULL allocated array */ inline array_t * -io_allocVars(u_int varnum) +io_allocVars(int varnum) { array_t *arr; register int i; @@ -456,12 +456,15 @@ io_allocVars(u_int varnum) /* * io_clrVars() Clear ait_val_t elements from array * @vars = Variable array - * return: none + * return: -1 error or size of array */ inline int io_clrVars(array_t * __restrict vars) { register int i; + + if (!vars) + return -1; for (i = 0; i < io_arraySize(vars); i++) if (io_arrayGet(vars, i))