diff src/lib-storage/list/mailbox-list-index-notify.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 a4d4a5dffa09
children 2e2563132d5f
line wrap: on
line diff
--- a/src/lib-storage/list/mailbox-list-index-notify.c	Tue Jan 10 19:23:30 2017 +0200
+++ b/src/lib-storage/list/mailbox-list-index-notify.c	Wed Jan 11 01:57:46 2017 +0100
@@ -172,7 +172,7 @@
 	}
 
 	/* get GUID */
-	memset(status_r, 0, sizeof(*status_r));
+	i_zero(status_r);
 	memset(guid_r, 0, GUID_128_SIZE);
 	(void)mailbox_list_index_status(inotify->notify.list, view, seq,
 					items, status_r, guid_r, NULL);
@@ -573,7 +573,7 @@
 	const char *storage_name;
 	char ns_sep = mailbox_list_get_hierarchy_sep(inotify->notify.list);
 
-	memset(rec, 0, sizeof(*rec));
+	i_zero(rec);
 	index_node = notify_lookup_guid(inotify, view, uid,
 					items, status_r, rec->guid);
 	if (index_node == NULL)
@@ -625,7 +625,7 @@
 	struct mailbox_list_notify_rec *rec = &inotify->notify_rec;
 	const char *const *vnamep;
 
-	memset(rec, 0, sizeof(*rec));
+	i_zero(rec);
 	vnamep = array_idx(&inotify->new_subscriptions, idx);
 	rec->vname = *vnamep;
 	rec->storage_name = mailbox_list_get_storage_name(inotify->notify.list,
@@ -641,7 +641,7 @@
 	struct mailbox_list_notify_rec *rec = &inotify->notify_rec;
 	const char *const *vnamep;
 
-	memset(rec, 0, sizeof(*rec));
+	i_zero(rec);
 	vnamep = array_idx(&inotify->new_unsubscriptions, idx);
 	rec->vname = *vnamep;
 	rec->storage_name = mailbox_list_get_storage_name(inotify->notify.list,
@@ -698,7 +698,7 @@
 						rec->storage_name);
 	if (nnode == NULL) {
 		/* mailbox didn't exist earlier - report all events as new */
-		memset(&empty_node, 0, sizeof(empty_node));
+		i_zero(&empty_node);
 		nnode = &empty_node;
 	}
 	if (nnode->uidvalidity != status.uidvalidity)
@@ -791,7 +791,7 @@
 	}
 	if (inotify->inbox_event_pending) {
 		inotify->inbox_event_pending = FALSE;
-		memset(&inotify->notify_rec, 0, sizeof(inotify->notify_rec));
+		i_zero(&inotify->notify_rec);
 		inotify->notify_rec.vname = "INBOX";
 		inotify->notify_rec.storage_name = "INBOX";
 		/* Don't bother trying to figure out which event exactly this