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.
PE> 65535 is the maximum you can store in an unsigned 16 bit field.
PE> However, what you said above is not correct. realloc takes
PE> as a parameter a size_t value. sizeof returns a size_t value.
PE> that is quite sufficient. If size_t only gets up to 65535,
FA> You're right of course,but it was farrealoc he asked about the first time.
Ok, that is fine then, the cast to long is required to avoid
integer multiplication with integer truncation. BFN. Paul.
@EOT:
---
* Origin: X (3:711/934.9)
|