hash is a fixed length string. Copying is always done to same length
authorSunil Nimmagadda <sunil@sunilnimmagadda.com>
Sat, 19 Apr 2014 17:29:17 +0500
changeset 20 efd945b7f3d2
parent 19 3d14d6437543
child 21 a591c0872243
hash is a fixed length string. Copying is always done to same length buffer. Explicitly cast to void for clarity.
maildrop.c
--- a/maildrop.c	Sat Apr 12 07:15:21 2014 +0500
+++ b/maildrop.c	Sat Apr 19 17:29:17 2014 +0500
@@ -282,7 +282,7 @@
 	do_list(req->idx, &sz, hash, sizeof(hash));
 	res.uidl = req->uidl;
 	if (res.uidl)
-		strlcpy(res.u.hash, hash, sizeof(res.u.hash));
+		(void)strlcpy(res.u.hash, hash, sizeof(res.u.hash));
 	else
 		res.u.sz = sz;
 
@@ -296,12 +296,12 @@
 {
 	if (m.msgs_index[idx]->flags & F_DELE) {
 		*sz = 0;
-		strlcpy(hash, "", hash_sz);
+		(void)strlcpy(hash, "", hash_sz);
 		return;
 	}
 
 	*sz = m.msgs_index[idx]->sz;
-	strlcpy(hash, m.msgs_index[idx]->hash, hash_sz);
+	(void)strlcpy(hash, m.msgs_index[idx]->hash, hash_sz);
 }
 
 static void
@@ -318,7 +318,7 @@
 		res.idx = i;
 		res.uidl = *uidl;
 		if (*uidl) {
-			strlcpy(res.u.hash, m.msgs_index[i]->hash,
+			(void)strlcpy(res.u.hash, m.msgs_index[i]->hash,
 			    sizeof(res.u.hash));
 		} else
 			res.u.sz = m.msgs_index[i]->sz;
@@ -331,7 +331,7 @@
 	res.uidl = *uidl;
 	/* terminal sentinel: hash = "" and sz = 0 */
 	if (*uidl)
-		strlcpy(res.u.hash, "", sizeof(res.u.hash));
+		(void)strlcpy(res.u.hash, "", sizeof(res.u.hash));
 	else
 		res.u.sz = 0;