FS-11993 [mod_http_cache][mod_smpp] fix gcc errors when building on rpi4 buster (strncpy to snprintf)

FS-11993 [mod_http_cache][mod_smpp] fix gcc errors when building on rpi4 buster (strncpy to snprintf)
This commit is contained in:
David Grant 2019-08-13 13:44:26 -05:00
parent 8c1697b9b2
commit 7a4a988dcb
2 changed files with 5 additions and 5 deletions

View File

@ -273,7 +273,7 @@ static void parse_domain(const char *url, char *domain_buf, int domain_buf_len)
if (!*start) {
return;
}
strncpy(domain_buf, start, domain_buf_len);
snprintf(domain_buf, domain_buf_len, "%s", start);
end = strchr(domain_buf, '/');
if (end) {
*end = '\0';
@ -985,7 +985,7 @@ static char *cached_url_filename_create(url_cache_t *cache, const char *url, cha
/* filename is constructed from UUID and is stored in cache dir (first 2 characters of UUID) */
switch_uuid_get(&uuid);
switch_uuid_format(uuid_str, &uuid);
strncpy(uuid_dir, uuid_str, 2);
snprintf(uuid_dir, sizeof(uuid_dir), "%.2s", uuid_str);
dirname = switch_mprintf("%s%s%s", cache->location, SWITCH_PATH_SEPARATOR, uuid_dir);
/* create sub-directory if it doesn't exist */

View File

@ -112,15 +112,15 @@ switch_status_t mod_smpp_gateway_authenticate(mod_smpp_gateway_t *gateway) {
strncpy( (char *)req_b->address_range, gateway->host, sizeof(req_b->address_range));
if ( gateway->system_id ) {
strncpy((char *)req_b->system_id, gateway->system_id, sizeof(req_b->system_id));
snprintf((char *)req_b->system_id, sizeof(req_b->system_id), "%s", gateway->system_id);
}
if ( gateway->password ) {
strncpy((char *)req_b->password, gateway->password, sizeof(req_b->password));
snprintf((char *)req_b->password, sizeof(req_b->password), "%s", gateway->password);
}
if ( gateway->system_type ) {
strncpy((char *)req_b->system_type, gateway->system_type, sizeof(req_b->system_type));
snprintf((char *)req_b->system_type, sizeof(req_b->system_type), "%s", gateway->system_type);
}
req_b->interface_version = SMPP_VERSION;