KH> where cur_arr_size is something like 110..
KH> when it should have been
KH> realloc(fareas,cur_arr_size * sizeof(FA));
FA> ^^^^^^^^^^^^ ^^^^^^^^^^
FA> Don't forget to cast those to a long, if the allocated memory goes passed
FA> 655?? i forget:)..
FA> it'll wrap around to 0 and that's what you'll allocate.Hence bye-bye data.
65535 is the maximum you can store in an unsigned 16 bit field.
However, what you said above is not correct. realloc takes
as a parameter a size_t value. sizeof returns a size_t value.
that is quite sufficient. If size_t only gets up to 65535,
then that's all you're going to get anyway, no matter how many
times you cast it to a long. BFN. Paul.
@EOT:
---
* Origin: X (3:711/934.9)
|