FS-11911: Fix build on Debian Buster

This commit is contained in:
Andrey Volk
2019-06-19 23:53:35 +04:00
parent 4f50a24a90
commit a7477ed0e2
24 changed files with 36 additions and 50 deletions
+3 -3
View File
@@ -50,7 +50,7 @@ static unsigned char esl_console_complete(const char *buffer, const char *cursor
#endif
typedef struct {
char name[128];
char name[256];
char host[128];
esl_port_t port;
char user[256];
@@ -1267,7 +1267,7 @@ static void read_config(const char *dft_cfile, const char *cfile) {
if (esl_config_open_file(&cfg, cfile) ||
esl_config_open_file(&cfg, dft_cfile)) {
char *var, *val;
char cur_cat[128] = "";
char cur_cat[256] = "";
while (esl_config_next_pair(&cfg, &var, &val)) {
if (strcmp(cur_cat, cfg.category)) {
esl_set_string(cur_cat, cfg.category);
@@ -1470,7 +1470,7 @@ int main(int argc, char *argv[])
int argv_error = 0;
int argv_exec = 0;
char argv_command[1024] = "";
char argv_loglevel[128] = "";
char argv_loglevel[127] = "";
int argv_log_uuid = 0;
int argv_log_uuid_short = 0;
int argv_quiet = 0;
+2 -2
View File
@@ -1399,7 +1399,7 @@ ESL_DECLARE(esl_status_t) esl_recv_event(esl_handle_t *handle, int check_q, esl_
hval = esl_event_get_header(revent, "reply-text");
if (!esl_strlen_zero(hval)) {
strncpy(handle->last_reply, hval, sizeof(handle->last_reply));
snprintf(handle->last_reply, sizeof(handle->last_reply), "%s", hval);
}
hval = esl_event_get_header(revent, "content-type");
@@ -1597,7 +1597,7 @@ ESL_DECLARE(esl_status_t) esl_send_recv_timed(esl_handle_t *handle, const char *
hval = esl_event_get_header(handle->last_sr_event, "reply-text");
if (!esl_strlen_zero(hval)) {
strncpy(handle->last_sr_reply, hval, sizeof(handle->last_sr_reply));
snprintf(handle->last_sr_reply, sizeof(handle->last_sr_reply), "%s", hval);
}
}
}
+2 -2
View File
@@ -40,8 +40,8 @@
extern "C" {
#endif /* defined(__cplusplus) */
#define esl_copy_string(_x, _y, _z) strncpy(_x, _y, _z - 1)
#define esl_set_string(_x, _y) esl_copy_string(_x, _y, sizeof(_x))
#define esl_copy_string(_x, _y, _z) snprintf(_x, _z, "%s", _y)
#define esl_set_string(_x, _y) esl_copy_string(_x, _y, sizeof(_x))
#define ESL_VA_NONE "%s", ""
typedef struct esl_event_header esl_event_header_t;
+1 -1
View File
@@ -113,7 +113,7 @@ struct esl_config {
/*! FILE stream buffer to the opened file */
FILE *file;
/*! path to the file */
char path[512];
char path[1024];
/*! current category */
char category[256];
/*! current section */
+1 -1
View File
@@ -58,7 +58,7 @@ getDevicesFromMiniSSDPD(const char * devtype, const char * socketpath)
return NULL;
}
addr.sun_family = AF_UNIX;
strncpy(addr.sun_path, socketpath, sizeof(addr.sun_path));
memcpy(addr.sun_path, socketpath, sizeof(addr.sun_path));
if(connect(s, (struct sockaddr *)&addr, sizeof(struct sockaddr_un)) < 0)
{
/*syslog(LOG_WARNING, "connect(\"%s\"): %m", socketpath);*/
@@ -34,6 +34,7 @@
#include "config.h"
#include <string.h>
#include <stdio.h>
#include "sofia-sip/su_alloc.h"
/** Duplicate a string, allocate memory from @a home.
@@ -54,7 +55,7 @@ char *su_strdup(su_home_t *home, char const *s)
size_t n = strlen(s);
char *retval = su_alloc(home, n + 1);
if (retval)
strncpy(retval, s, n)[n] = 0;
snprintf(retval, n + 1, "%s", s);
return retval;
}
return NULL;