TIP: Click on subject to list as thread! ANSI
echo: aust_c_here
to: Frank Adam
from: Paul Edwards
date: 1996-01-16 22:40:50
subject: Re: Realloc

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)

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.