aboutsummaryrefslogtreecommitdiffstats
path: root/XAlloc.h
diff options
context:
space:
mode:
authorGraham Inggs <ginggs@debian.org>2018-02-05 14:48:51 +0200
committerGraham Inggs <ginggs@debian.org>2018-02-05 14:48:51 +0200
commit2ee50d030178cede83eb9d0005fbc19f819d30fe (patch)
tree67d75c0a7c47e15bed9d0735ecf12abec4f8157b /XAlloc.h
parent31b71b67011fa52f091df6fe536a11d6d0bfb256 (diff)
downloaddebian_htop-2ee50d030178cede83eb9d0005fbc19f819d30fe.tar.gz
debian_htop-2ee50d030178cede83eb9d0005fbc19f819d30fe.tar.bz2
debian_htop-2ee50d030178cede83eb9d0005fbc19f819d30fe.zip
Imported Upstream version 2.1.0upstream/2.1.0
Diffstat (limited to 'XAlloc.h')
-rw-r--r--XAlloc.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/XAlloc.h b/XAlloc.h
index eaebb08..2ebee1a 100644
--- a/XAlloc.h
+++ b/XAlloc.h
@@ -7,6 +7,7 @@
#define _GNU_SOURCE
#endif
+#include <err.h>
#include <assert.h>
#include <stdlib.h>
@@ -16,6 +17,8 @@ void* xCalloc(size_t nmemb, size_t size);
void* xRealloc(void* ptr, size_t size);
+#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
#undef xStrdup_
#ifdef NDEBUG

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