]> diplodocus.org Git - nmh/blobdiff - h/utils.h
Print pointers in debug with C99's `%p' rather than `0x%x'.
[nmh] / h / utils.h
index 19fbdcc6d253675e94f227cbb47c8f35306faa7f..dd3fb431815e5b16e19f0bbdbeda2112e8d692c0 100644 (file)
--- a/h/utils.h
+++ b/h/utils.h
@@ -31,6 +31,9 @@ void mh_xfree(void *ptr);
 /* Set p to point to newly allocated, zeroed, memory. */
 #define NEW0(p) ((p) = mh_xcalloc(1, sizeof *(p)))
 
+/* Zero the bytes to which p points. */
+#define ZERO(p) memset((p), 0, sizeof *(p))
+
 char *pwd(void);
 char *add(const char *, char *);
 char *addlist(char *, const char *);