X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/c066b395274021182a5f0530ccfeb1bcd167d860..faf6326828be2108facd64fcca291c4ffb523eea:/h/utils.h diff --git a/h/utils.h b/h/utils.h index b7458268..597569b5 100644 --- a/h/utils.h +++ b/h/utils.h @@ -11,16 +11,16 @@ extern const char plurals[]; #define PLURALS(n) (plurals + ((n) == 1)) /* Call malloc(3), exiting on NULL return. */ -void *mh_xmalloc(size_t size) ALLOC_SIZE(1); +void *mh_xmalloc(size_t size) MALLOC ALLOC_SIZE(1); /* Call realloc(3), exiting on NULL return. */ void *mh_xrealloc(void *ptr, size_t size) ALLOC_SIZE(2); /* Call calloc(3), exiting on NULL return. */ -void *mh_xcalloc(size_t nelem, size_t elsize) ALLOC_SIZE2(1, 2); +void *mh_xcalloc(size_t nelem, size_t elsize) MALLOC ALLOC_SIZE(1, 2); /* Duplicate a NUL-terminated string, exit on failure. */ -char *mh_xstrdup(const char *src); +char *mh_xstrdup(const char *src) MALLOC; /* Call free(3), if ptr isn't NULL. */ void mh_xfree(void *ptr); @@ -35,8 +35,8 @@ void mh_xfree(void *ptr); #define ZERO(p) memset((p), 0, sizeof *(p)) char *pwd(void); -char *add(const char *, char *); -char *addlist(char *, const char *); +char *add(const char *, char *) MALLOC; +char *addlist(char *, const char *) MALLOC; int folder_exists(const char *); void create_folder(char *, int, void (*)(int)); int num_digits(int);