mirror of
				https://github.com/osmarks/ngircd.git
				synced 2025-10-31 14:02:59 +00:00 
			
		
		
		
	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 ...
This commit is contained in:
		| @@ -149,7 +149,8 @@ Lists_Add(struct list_head *h, const char *Mask, time_t ValidUntil, | |||||||
| 	if (Reason) { | 	if (Reason) { | ||||||
| 		newelem->reason = malloc(strlen(Reason) + 1); | 		newelem->reason = malloc(strlen(Reason) + 1); | ||||||
| 		if (newelem->reason) | 		if (newelem->reason) | ||||||
| 			strlcpy(newelem->reason, Reason, strlen(Reason) + 1); | 			strlcpy(newelem->reason, Reason, | ||||||
|  | 				sizeof(newelem->reason)); | ||||||
| 		else | 		else | ||||||
| 			Log(LOG_EMERG, | 			Log(LOG_EMERG, | ||||||
| 			    "Can't allocate memory for new list reason text!"); | 			    "Can't allocate memory for new list reason text!"); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Alexander Barton
					Alexander Barton