Fixed minor issues found with static code analyzis (Clang).

This commit is contained in:
Jan Vidar Krey 2012-01-13 01:31:17 +01:00
parent 0ae8a08f55
commit a9b5c6db38
2 changed files with 3 additions and 4 deletions

View File

@ -86,7 +86,8 @@ static int check_cmd_user(const char* cmd, int status, struct linked_list* list,
}
strncpy(info->nickname, data, MAX_NICK_LEN);
strncpy(info->password, data_extra, MAX_PASS_LEN);
if (data_extra)
strncpy(info->password, data_extra, MAX_PASS_LEN);
info->credentials = status;
list_append(list, info);
LOG_DEBUG("ACL: Added user '%s' (%s)", info->nickname, auth_cred_to_string(info->credentials));

View File

@ -203,7 +203,6 @@ int ip_mask_create_left(int af, int bits, struct ip_addr_encap* result)
fill = (128-bits) / 8;
remain_bits = (128-bits) % 8;
mask = (0xff << (8 - remain_bits));
n = 0;
for (n = 0; n < fill; n++)
((uint8_t*) &result->internal_ip_data.in6)[n] = (uint8_t) 0xff;
@ -252,7 +251,6 @@ int ip_mask_create_right(int af, int bits, struct ip_addr_encap* result)
fill = (128-bits) / 8;
remain_bits = (128-bits) % 8;
mask8 = (0xff >> (8 - remain_bits));
n = 0;
start = 16-fill;
for (n = 0; n < start; n++)