aboutsummaryrefslogtreecommitdiffstats
path: root/XAlloc.c
diff options
context:
space:
mode:
authorDaniel Lange <DLange@git.local>2020-08-27 07:48:11 +0200
committerDaniel Lange <DLange@git.local>2020-08-27 07:48:11 +0200
commit7a637ff1dea1a02a42e55aa79f03a9e85a576207 (patch)
tree3d12e9808eb554ad8017fcd9059864f92d51d104 /XAlloc.c
parentdfb05211d32675faebac6fd76ef58d9e303a90e7 (diff)
parentf3147ea2d1598914c2db53e8cfb34c8ff81e2ff4 (diff)
downloaddebian_htop-7a637ff1dea1a02a42e55aa79f03a9e85a576207.tar.gz
debian_htop-7a637ff1dea1a02a42e55aa79f03a9e85a576207.tar.bz2
debian_htop-7a637ff1dea1a02a42e55aa79f03a9e85a576207.zip
Update upstream source from tag 'upstream/3.0.0'
Update to upstream version '3.0.0' with Debian dir 8c9e99b342a3fc4208a5abe239b39578f8563a2c
Diffstat (limited to 'XAlloc.c')
-rw-r--r--XAlloc.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/XAlloc.c b/XAlloc.c
index fbc642c..4aa8e21 100644
--- a/XAlloc.c
+++ b/XAlloc.c
@@ -14,7 +14,7 @@
#include <stdlib.h>
}*/
-static inline void fail() {
+void fail() {
curs_set(1);
endwin();
err(1, NULL);
@@ -44,6 +44,10 @@ void* xRealloc(void* ptr, size_t size) {
return data;
}
+#undef xAsprintf
+
+#define xAsprintf(strp, fmt, ...) do { int _r=asprintf(strp, fmt, __VA_ARGS__); if (_r < 0) { fail(); } } while(0)
+
#define xSnprintf(fmt, len, ...) do { int _l=len; int _n=snprintf(fmt, _l, __VA_ARGS__); if (!(_n > -1 && _n < _l)) { curs_set(1); endwin(); err(1, NULL); } } while(0)
#undef xStrdup

© 2014-2024 Faster IT GmbH | imprint | privacy policy