summaryrefslogtreecommitdiffstats
path: root/common/os_calls.c
diff options
context:
space:
mode:
authorKoichiro IWAO <meta@vmeta.jp>2017-10-02 16:30:29 +0900
committermetalefty <meta@vmeta.jp>2017-10-03 21:55:08 +0900
commit00bf62bd42173ba0fc9e28f007a05ea4bc5cd8e1 (patch)
tree6f2a673c25b63176d2bc2854f1085e4eafe1cd74 /common/os_calls.c
parentbe23682f909137919b2c72d1ae48bdb04a3f9c15 (diff)
downloadxrdp-proprietary-00bf62bd42173ba0fc9e28f007a05ea4bc5cd8e1.tar.gz
xrdp-proprietary-00bf62bd42173ba0fc9e28f007a05ea4bc5cd8e1.zip
common: prevent raw use of snprintf
Diffstat (limited to 'common/os_calls.c')
-rw-r--r--common/os_calls.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/common/os_calls.c b/common/os_calls.c
index 642ba4a0..43064c40 100644
--- a/common/os_calls.c
+++ b/common/os_calls.c
@@ -1180,9 +1180,9 @@ g_tcp_accept(int sck)
{
struct sockaddr_in *sock_addr_in = &sock_info.sock_addr_in;
- snprintf(msg, sizeof(msg), "A connection received from %s port %d",
- inet_ntoa(sock_addr_in->sin_addr),
- ntohs(sock_addr_in->sin_port));
+ g_snprintf(msg, sizeof(msg), "A connection received from %s port %d",
+ inet_ntoa(sock_addr_in->sin_addr),
+ ntohs(sock_addr_in->sin_port));
log_message(LOG_LEVEL_INFO, "%s", msg);
break;
@@ -1197,8 +1197,8 @@ g_tcp_accept(int sck)
inet_ntop(sock_addr_in6->sin6_family,
&sock_addr_in6->sin6_addr, addr, sizeof(addr));
- snprintf(msg, sizeof(msg), "A connection received from %s port %d",
- addr, ntohs(sock_addr_in6->sin6_port));
+ g_snprintf(msg, sizeof(msg), "A connection received from %s port %d",
+ addr, ntohs(sock_addr_in6->sin6_port));
log_message(LOG_LEVEL_INFO, "%s", msg);
break;
@@ -1358,13 +1358,13 @@ g_write_ip_address(int rcv_sck, char *ip_address, int bytes)
if (ok)
{
- snprintf(ip_address, bytes, "%s:%d - socket: %d", addr, port, rcv_sck);
+ g_snprintf(ip_address, bytes, "%s:%d - socket: %d", addr, port, rcv_sck);
}
}
if (!ok)
{
- snprintf(ip_address, bytes, "NULL:NULL - socket: %d", rcv_sck);
+ g_snprintf(ip_address, bytes, "NULL:NULL - socket: %d", rcv_sck);
}
g_free(addr);