Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
dn3500
19 days ago
|
parent
|
context
|
favorite
| on:
Why malloc always does more than I asked for?
Your test is backwards. I would write it like this:
if (size > a->limit - a->cursor) return NULL;
CodesInChaos
19 days ago
[–]
You're right. Fixed.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: