From 78e968dd789ca8d1cac8da3715352184bca2a188 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Sun, 13 Jun 2021 15:51:43 -0400 Subject: util: New xconfstr() wrapper --- util.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'util.h') diff --git a/util.h b/util.h index 4542a46..1a34fba 100644 --- a/util.h +++ b/util.h @@ -264,4 +264,14 @@ size_t xread(int fd, void *buf, size_t nbytes); */ size_t xwrite(int fd, const void *buf, size_t nbytes); +/** + * Wrapper for confstr() that allocates with malloc(). + * + * @param name + * The ID of the confstr to look up. + * @return + * The value of the confstr, or NULL on failure. + */ +char *xconfstr(int name); + #endif // BFS_UTIL_H -- cgit v1.2.3