summaryrefslogtreecommitdiffstats
path: root/src/util.h
diff options
context:
space:
mode:
authorLouis Burda <quent.burda@gmail.com>2023-01-11 23:44:04 +0100
committerLouis Burda <quent.burda@gmail.com>2023-01-11 23:44:04 +0100
commit964d816726b8c765277b043894d534e9b1e0d60c (patch)
tree0a7769532ebd41007a914889a0e96d171ad1ca55 /src/util.h
parenta9d37006eae7227d498c7c658360ee1e43b3e054 (diff)
downloadtmus-964d816726b8c765277b043894d534e9b1e0d60c.tar.gz
tmus-964d816726b8c765277b043894d534e9b1e0d60c.zip
Check aprintf allocation internally and add astrdup for less OOM_CHECK
Diffstat (limited to 'src/util.h')
-rw-r--r--src/util.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/util.h b/src/util.h
index 1d220dc..5ae8b74 100644
--- a/src/util.h
+++ b/src/util.h
@@ -8,7 +8,6 @@
#define PANIC(...) panic(__FILE__, __LINE__, "" __VA_ARGS__)
#define ASSERT(x) assert((x), __FILE__, __LINE__, #x)
-#define OOM_CHECK(x) assert((x) != NULL, __FILE__, __LINE__, "Out of Memory!")
#define ERROR(...) error("" __VA_ARGS__)
#define UPCAST(iter, type, link) LINK_UPCAST(iter, type, link)
@@ -17,6 +16,7 @@ void panic(const char *file, int line, const char *msg, ...);
void assert(int cond, const char *file, int line, const char *condstr);
void error(const char *fmtstr, ...);
+char *astrdup(const char *str);
char *aprintf(const char *fmtstr, ...);
char *appendstrf(char *alloc, const char *fmtstr, ...);