Mercurial > dovecot > core-2.2
diff src/lib-mail/message-address.c @ 21389:59437f8764c6
global: Replaced all instances of memset(p, 0, sizeof(*p)) with the new i_zero() macro.
Used the following script:
C_FILES=`git ls-files *.c`
H_FILES=`git ls-files *.h`
for F in "$C_FILES $H_FILES"; do
echo "$F"
perl -p -i -e 's/safe_memset\(&\(?([^,]*)\)?,\s*0,\s*sizeof\(\g1\)\)/i_zero_safe(&$1)/g' $F
perl -p -i -e 's/safe_memset\(([^,]*),\s*0,\s*sizeof\(\*\g1\)\)/i_zero_safe($1)/g' $F
perl -p -i -e 's/memset\(&\(?([^,]*)\)?,\s*0,\s*sizeof\(\g1\)\)/i_zero(&$1)/g' $F
perl -p -i -e 's/memset\(([^,]*),\s*0,\s*sizeof\(\*\g1\)\)/i_zero($1)/g' $F
done
author | Stephan Bosch <stephan.bosch@dovecot.fi> |
---|---|
date | Wed, 11 Jan 2017 01:57:46 +0100 |
parents | 2d5f8e678f7c |
children | 2e2563132d5f |
line wrap: on
line diff
--- a/src/lib-mail/message-address.c Tue Jan 10 19:23:30 2017 +0200 +++ b/src/lib-mail/message-address.c Wed Jan 11 01:57:46 2017 +0100 @@ -23,7 +23,7 @@ addr = p_new(ctx->pool, struct message_address, 1); memcpy(addr, &ctx->addr, sizeof(ctx->addr)); - memset(&ctx->addr, 0, sizeof(ctx->addr)); + i_zero(&ctx->addr); if (ctx->first_addr == NULL) ctx->first_addr = addr; @@ -307,7 +307,7 @@ { struct message_address_parser_context ctx; - memset(&ctx, 0, sizeof(ctx)); + i_zero(&ctx); rfc822_parser_init(&ctx.parser, data, size, t_str_new(128)); ctx.pool = pool;