aboutsummaryrefslogtreecommitdiffstats
path: root/XAlloc.c
diff options
context:
space:
mode:
authorGraham Inggs <ginggs@debian.org>2018-02-05 14:48:53 +0200
committerGraham Inggs <ginggs@debian.org>2018-02-05 14:48:53 +0200
commit0bffedf65c053726a3a09be93c5eabfc113550fc (patch)
tree8c14970f1890c710df6f72aaa85781d62cee11e5 /XAlloc.c
parentba3d665468e9752a81a50bb2df7639950e0a3c77 (diff)
parent2ee50d030178cede83eb9d0005fbc19f819d30fe (diff)
downloaddebian_htop-0bffedf65c053726a3a09be93c5eabfc113550fc.tar.gz
debian_htop-0bffedf65c053726a3a09be93c5eabfc113550fc.tar.bz2
debian_htop-0bffedf65c053726a3a09be93c5eabfc113550fc.zip
Merge tag 'upstream/2.1.0'
Upstream version 2.1.0
Diffstat (limited to 'XAlloc.c')
-rw-r--r--XAlloc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/XAlloc.c b/XAlloc.c
index 5f2e9a4..fbc642c 100644
--- a/XAlloc.c
+++ b/XAlloc.c
@@ -5,11 +5,11 @@
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
-#include <err.h>
#include <stdlib.h>
#include <string.h>
/*{
+#include <err.h>
#include <assert.h>
#include <stdlib.h>
}*/
@@ -44,6 +44,8 @@ void* xRealloc(void* ptr, size_t size) {
return data;
}
+#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