Changeset 8816
- Timestamp:
- Sep 15, 2006, 4:38:25 AM (20 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/types/psArray.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/types/psArray.c
r8804 r8816 9 9 * @author Ross Harman, MHPCC 10 10 * 11 * @version $Revision: 1.5 1$ $Name: not supported by cvs2svn $12 * @date $Date: 2006-09-1 2 21:55:49$11 * @version $Revision: 1.52 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2006-09-15 14:38:25 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 164 164 PS_ASSERT_PTR_NON_NULL(array, false); 165 165 166 if (position >array->n) {166 if (position < 0 || position >= array->n) { 167 167 psError(PS_ERR_BAD_PARAMETER_NULL, true, 168 168 _("position > then the number of elements in the array.")); … … 174 174 psFree(array->data[i]); 175 175 memmove(&array->data[i], &array->data[i + 1], (n - i - 1) * sizeof(psPtr)); 176 array->n = --i; // reset the array size to indicate the removed item(s)176 array->n--; // reset the array size to indicate the removed item 177 177 178 178 return true;
Note:
See TracChangeset
for help on using the changeset viewer.
