util: use assert() instead of abort() for testing for size limits

This way we can send a message to the user, a simple abort() isn't informative
enough.

Fixes https://gitlab.freedesktop.org/libinput/libinput/issues/54

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2018-06-22 09:36:20 +10:00
parent 304441df3e
commit 5354226e59

View file

@ -145,7 +145,7 @@ zalloc(size_t size)
/* We never need to alloc anything more than 1,5 MB so we can assume
* if we ever get above that something's going wrong */
if (size > 1536 * 1024)
abort();
assert(!"bug: internal malloc size limit exceeded");
p = calloc(1, size);
if (!p)