/* 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 *);
return NOTOK;
}
- memset(&hints, 0, sizeof(hints));
+ ZERO(&hints);
#ifdef AI_ADDRCONFIG
hints.ai_flags = AI_ADDRCONFIG;
#endif
int form_1 = 0;
int items_matched;
- memset(tws, 0, sizeof *tws);
+ ZERO(tws);
items_matched =
sscanf (datetime, "%4d%2d%2dT%2d%2d%2d%c",
&tws->tw_year, &tws->tw_mon, &tws->tw_mday,
%a5000
%{
#include <h/nmh.h>
+#include <h/utils.h>
#include <h/tws.h>
/* Since we're looking at a string at a time, don't worry about
char *cp;
static struct tws tw;
- memset(&tw,0,sizeof(struct tws));
+ ZERO(&tw);
lexhandle = yy_scan_string(lexstr);
%}
CERROR("component used as both date and address");
}
if (cm->c_tws) {
- memset (cm->c_tws, 0, sizeof *cm->c_tws);
+ ZERO(cm->c_tws);
} else {
NEW0(cm->c_tws);
}
*comp->c_tws = *tws;
comp->c_flags &= ~CF_TRUE;
} else if ((comp->c_flags & CF_DATEFAB) == 0) {
- memset (comp->c_tws, 0, sizeof *comp->c_tws);
+ ZERO(comp->c_tws);
comp->c_flags = CF_TRUE;
}
comp->c_flags |= CF_PARSED;
gethostname (buf, sizeof(buffer0) - 1);
/* now fully qualify our name */
- memset(&hints, 0, sizeof(hints));
+ ZERO(&hints);
hints.ai_flags = AI_CANONNAME;
hints.ai_family = PF_UNSPEC;
if (getaddrinfo(buf, NULL, &hints, &res) == 0) {
* messages.
*/
- memset(&secprops, 0, sizeof(secprops));
+ ZERO(&secprops);
secprops.maxbufsize = SASL_MAXRECVBUF;
/*
*/
if (dupaddrs == 0 || trace) {
- memset(&cb, 0, sizeof(cb));
+ ZERO(&cb);
cbp = &cb;
if (dupaddrs == 0) {
dat[2] = 0;
dat[3] = outputlinelen;
dat[4] = 0;
- memset(&cb, 0, sizeof(cb));
+ ZERO(&cb);
cb.formataddr = replformataddr;
cb.concataddr = replconcataddr;
fmt_scan (fmt, scanl, i, dat, &cb);