mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-17 09:12:25 +00:00
Merge pull request #1758 in FS/freeswitch from bugfix/FS-11950-fix-gcc8-errors-in-mod_pgsql to master
* commit '3fa1f3b76c19416ede809f5463308c9a7d426548': FS-11950: [mod_pgsql] Fix gcc8 errors replacing strncpy with snprintf.
This commit is contained in:
commit
b6600f8eee
@ -939,14 +939,12 @@ switch_status_t pgsql_handle_callback_exec_detailed(const char *file, const char
|
||||
if (tmp) {
|
||||
len = strlen(tmp);
|
||||
names[col] = malloc(len + 1);
|
||||
names[col][len] = '\0';
|
||||
strncpy(names[col], tmp, len);
|
||||
snprintf(names[col], len + 1, "%s", tmp);
|
||||
|
||||
len = PQgetlength(result->result, row, col);
|
||||
vals[col] = malloc(len + 1);
|
||||
vals[col][len] = '\0';
|
||||
tmp = PQgetvalue(result->result, row, col);
|
||||
strncpy(vals[col], tmp, len);
|
||||
snprintf(vals[col], len + 1, "%s", tmp);
|
||||
/*switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Processing result row %d, col %d: %s => %s\n", row, col, names[col], vals[col]);*/
|
||||
} else {
|
||||
/*switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Processing result row %d, col %d.\n", row, col);*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user