summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2018-06-22 09:36:20 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2018-06-22 09:37:20 +1000
commit5354226e5960c2beb7b1ef7adaae8631328978f7 (patch)
treed29a728b9769c4d04ca54b1cbc90449748bbfe74 /src
parent304441df3e8256dced2ff4602481bdd9716dfc4a (diff)
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>
Diffstat (limited to 'src')
-rw-r--r--src/libinput-util.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libinput-util.h b/src/libinput-util.h
index 720f388b..fadf11c2 100644
--- a/src/libinput-util.h
+++ b/src/libinput-util.h
@@ -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)