diff options
author | Roberto E. Vargas Caballero <k0ga@shike2.com> | 2012-09-12 21:25:35 +0200 |
---|---|---|
committer | Roberto E. Vargas Caballero <k0ga@shike2.com> | 2012-09-12 21:25:35 +0200 |
commit | adc463157490fa4c15cf3daf3fc9780e8d8abcb1 (patch) | |
tree | d33460dc4e682f5faf63df222ddd7c7a8ccaeb4e /config.def.h | |
parent | 91d32161fc1d16f5b0235f0ffe7b56b4c9c07e45 (diff) | |
download | st-adc463157490fa4c15cf3daf3fc9780e8d8abcb1.tar.gz st-adc463157490fa4c15cf3daf3fc9780e8d8abcb1.tar.bz2 |
Add xmalloc and xrealloc wrappers
If malloc or realloc fail they return NULL. Theorically this condition
should be tested in the code, but it's a strange condition today (basically
if this is hapenning thenyou have a big problem), and even Linux never returns
NULL in the default configuration (only if the process don't have room in
the space address, something a bit impossible in the case of st). But stis
enough small for being executed in low resources computers where this can be
a real problem. So the easy way is creating a wrappers function for them and
call to die in case of error.
---
st.c | 44 +++++++++++++++++++++++++++++++-------------
1 file changed, 31 insertions(+), 13 deletions(-)
Diffstat (limited to 'config.def.h')
0 files changed, 0 insertions, 0 deletions