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';
/* 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 */
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;