aboutsummaryrefslogtreecommitdiffstats
path: root/src/zsetup.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2016-04-26 23:17:02 +0200
committerMattias Andrée <maandree@kth.se>2016-04-26 23:17:02 +0200
commitc07798feb5475b47562d6f9e90a564fc1121d25e (patch)
treed7c9577a9974ff8f04b000278c3937b26096ed0a /src/zsetup.c
parentzzero1 did not guarantee that all arguments were evaulated exactly once, thus made static inline (diff)
downloadlibzahl-c07798feb5475b47562d6f9e90a564fc1121d25e.tar.gz
libzahl-c07798feb5475b47562d6f9e90a564fc1121d25e.tar.bz2
libzahl-c07798feb5475b47562d6f9e90a564fc1121d25e.tar.xz
Add, and use, libzahl_memfailure for conciseness, also fix possible unset errno
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'src/zsetup.c')
-rw-r--r--src/zsetup.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/zsetup.c b/src/zsetup.c
index e36bff3..212a1e9 100644
--- a/src/zsetup.c
+++ b/src/zsetup.c
@@ -45,11 +45,8 @@ zsetup(jmp_buf env)
zinit(libzahl_tmp_divmod_ds[i]);
libzahl_temp_stack = malloc(256 * sizeof(*libzahl_temp_stack));
- if (unlikely(!libzahl_temp_stack)) {
- if (!errno) /* sigh... */
- errno = ENOMEM;
- libzahl_failure(errno);
- }
+ if (unlikely(!libzahl_temp_stack))
+ libzahl_memfailure();
libzahl_temp_stack_head = libzahl_temp_stack;
libzahl_temp_stack_end = libzahl_temp_stack + 256;
}