about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorAlexander Barton <alex@barton.de>2012-04-17 12:54:38 +0200
committerAlexander Barton <alex@barton.de>2012-04-17 12:54:38 +0200
commit8ec17063a6e651229e04605592ce3d6114075655 (patch)
tree0d675f93ddbfdb997a765c72fa17ad3bf8c48949 /src
parent67bd1bf34fc3f7bebb304cdf84284523c8ea09f5 (diff)
downloadngircd-8ec17063a6e651229e04605592ce3d6114075655.tar.gz
ngircd-8ec17063a6e651229e04605592ce3d6114075655.zip
Lists_Add(): use size of destination when copying data
This fixes the following warning of clang:

/src/ngircd/lists.c:152:44:
 warning: size argument in 'strlcpy' call appears to be size of the
 source; expected the size of the destination [-Wstrlcpy-strlcat-size]

But it isn't a real problem, because the size of the source always is the
same than the size of the destination ...
Diffstat (limited to 'src')
-rw-r--r--src/ngircd/lists.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ngircd/lists.c b/src/ngircd/lists.c
index 4f57ca73..45a4874b 100644
--- a/src/ngircd/lists.c
+++ b/src/ngircd/lists.c
@@ -149,7 +149,8 @@ Lists_Add(struct list_head *h, const char *Mask, time_t ValidUntil,
 	if (Reason) {
 		newelem->reason = malloc(strlen(Reason) + 1);
 		if (newelem->reason)
-			strlcpy(newelem->reason, Reason, strlen(Reason) + 1);
+			strlcpy(newelem->reason, Reason,
+				sizeof(newelem->reason));
 		else
 			Log(LOG_EMERG,
 			    "Can't allocate memory for new list reason text!");