FS-11911: Fix build on Debian Buster

This commit is contained in:
Andrey Volk committed 2019-07-15 22:23:25 +04:00
1 parent 4f50a24a90
commit a7477ed0e2
24 files changed
+36 -50

No files matched your search

-3
View File
@@ -35,9 +35,6 @@
#ifdef _MSC_VER
#include <io.h>
#include <WinSock2.h>
#if _MSC_VER < 1900
#define snprintf _snprintf
#endif
typedef SOCKET credis_socket_t;
#define CREDIS_SOCK_INVALID INVALID_SOCKET
#else
@@ -302,7 +302,7 @@ static ks_status_t mod_signalwire_adoption_post(void)
status = KS_STATUS_FAIL;
goto done;
}
strncpy(globals.adoption_data_external_ip, external_ip, sizeof(globals.adoption_data_external_ip));
snprintf(globals.adoption_data_external_ip, sizeof(globals.adoption_data_external_ip), "%s", external_ip);
}
if (!globals.adoption_data_uname[0]) {
@@ -609,7 +609,7 @@ static switch_status_t mod_signalwire_load_or_generate_token(void)
token[len - 1] = '\0';
}
strncpy(globals.adoption_token, token, sizeof(globals.adoption_token) - 1);
snprintf(globals.adoption_token, sizeof(globals.adoption_token), "%s", token);
}
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO,
@@ -674,7 +674,7 @@ static switch_status_t load_config()
}
if ((data = getenv("SW_ADOPTION_SERVICE"))) {
strncpy(globals.adoption_service, data, sizeof(globals.adoption_service));
snprintf(globals.adoption_service, sizeof(globals.adoption_service), "%s", data);
}
swclt_config_load_from_env(globals.config);
@@ -1032,7 +1032,7 @@ static void mod_signalwire_state_online(void)
static void mod_signalwire_state_configure(void)
{
switch_memory_pool_t *pool = NULL;
char local_ip[256];
char local_ip[64];
switch_port_t local_port = 6050;
char local_endpoint[256];
char *external_ip;
+1 -1
View File
@@ -5760,7 +5760,7 @@ void general_event_handler(switch_event_t *event)
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "EVENT_TRAP: IP change detected\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "IP change detected [%s]->[%s] [%s]->[%s]\n", old_ip4, new_ip4, old_ip6, new_ip6);
strncpy(mod_sofia_globals.guess_ip, new_ip4, sizeof(mod_sofia_globals.guess_ip));
snprintf(mod_sofia_globals.guess_ip, sizeof(mod_sofia_globals.guess_ip), "%s", new_ip4);
switch_mutex_lock(mod_sofia_globals.hash_mutex);
if (mod_sofia_globals.profile_hash) {
+1 -1
View File
@@ -2412,7 +2412,7 @@ void sofia_reg_handle_sip_r_register(int status,
if (de && de->data && de->data->e_msg) {
if (!zstr_buf(gateway->register_network_ip)) {
strncpy(oregister_network_ip, gateway->register_network_ip, sizeof(oregister_network_ip) - 1);
snprintf(oregister_network_ip, sizeof(oregister_network_ip), "%s", gateway->register_network_ip);
}
sofia_glue_get_addr(de->data->e_msg, network_ip, sizeof(network_ip), &gateway->register_network_port);
if (!zstr_buf(network_ip)) {
@@ -56,9 +56,6 @@ extern "C" {
#ifndef strncasecmp
#define strncasecmp _strnicmp
#endif
#if _MSC_VER < 1900
#define snprintf _snprintf
#endif
#ifdef _WIN64
#define WS_SSIZE_T __int64
#elif _MSC_VER >= 1400
-3
View File
@@ -40,9 +40,6 @@
#ifndef strncasecmp
#define strncasecmp _strnicmp
#endif
#if _MSC_VER < 1900
#define snprintf _snprintf
#endif
#ifdef _WIN64
#define WS_SSIZE_T __int64
#elif _MSC_VER >= 1400
@@ -333,8 +333,7 @@ static size_t header_callback(char *buffer, size_t size, size_t nitems, void *us
int len = strlen(buffer);
char buf[1024];
if(len > 2 && len < 1024) {
strncpy(buf, buffer, len-2);
buf[len-2] = '\0';
snprintf(buf, sizeof(buf), "%s", buffer);
switch_event_add_header_string(event, SWITCH_STACK_PUSH | SWITCH_STACK_BOTTOM, "Reply-Headers", buf);
}
return nitems * size;
+1 -1
View File
@@ -252,7 +252,7 @@ static switch_status_t ja_say_time(switch_core_session_t *session, char *tosay,
const char *tz = switch_channel_get_variable(channel, "timezone");
int mod_min;
char buffer[3];
char buffer[11];
if (say_args->type == SST_TIME_MEASUREMENT) {
-3
View File
@@ -13,9 +13,6 @@
#include <sys/socket.h>
#else
#pragma warning(disable:4996)
#if _MSC_VER < 1900
#define snprintf _snprintf
#endif
#endif
#include <string.h>
#include <string.h>