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 committed 2019-08-24 22:48:59 -05:00
1 parent 8c1697b9b2
commit 7a4a988dcb
2 files changed
+5 -5

No files matched your search

@@ -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 */