Commit Graph

6 Commits

Author SHA1 Message Date
Explorer09 7d3f67e822 Revert 5c593fae42 (xCalloc)
calloc() allows 'nmemb' or 'size' to be zero, in which case NULL may be
returned. Letting htop die because of either argument being zero doesn't
make sense.

As a side note: As size_t is unsigned, compiler should be able to optimize
conditional (nmemb > 0 && size > 0) to (nmemb && size). This theorically
shouldn't increase code size too much.
2016-03-11 10:43:31 +08:00
Hisham 807640e49b Shorten the code using the err() function. 2016-02-03 12:42:25 +00:00
Hisham 5c593fae42 Be stricter! 2016-02-03 02:02:30 +00:00
Hisham f87462d60e Exit on failure! 2016-02-02 16:03:00 +01:00
Hisham b54d2dde40 Check for failure in allocations. 2016-02-02 15:53:02 +01:00
Hisham a1f7f2869e Add allocation tests 2016-01-31 12:01:48 +01:00