#165 closed enhancement (fixed)
Various realloc functions refuse to handle NULL pointers
| Reported by: | Owned by: | ||
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | sys | Version: | unspecified |
| Severity: | minor | Keywords: | |
| Cc: |
Description
realloc(NULL, n) is defined to be the same as malloc(n); we should follow this convention
for all of our realloc functions (e.g. psVectorRealloc)
Change History (2)
comment:1 by , 22 years ago
| Owner: | changed from to |
|---|
comment:2 by , 22 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
Note:
See TracTickets
for help on using tickets.

Checked the realloc routines and all but psVectorRealloc and psArrayRealloc
behave as you expected. psVectorRealloc, however, can not do this because
without a input vector to resize, there is no way to determine the desired
datatype for the resulting vector.
As psArrayRealloc was based on psVectorRealloc, it had the same behaviour, but
since it does not support have multiple datatypes (just void*), I changed it to
behave more like psRealloc.