summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Augier2013-01-30 05:00:01 (EST)
committer Eugene Tarassov2013-01-30 16:10:15 (EST)
commit6cb0dbd6dd446e9dba6064df715f1b893653a967 (patch)
tree052c3afff6199981c4e432ade93981777cc7d54c
parent4c45841a967ef4d9f200c5537c933dcafa199d52 (diff)
downloadorg.eclipse.tcf.agent-6cb0dbd6dd446e9dba6064df715f1b893653a967.zip
org.eclipse.tcf.agent-6cb0dbd6dd446e9dba6064df715f1b893653a967.tar.gz
org.eclipse.tcf.agent-6cb0dbd6dd446e9dba6064df715f1b893653a967.tar.bz2
Fix Warning in call to snprintf with literal format string
Without this patch, gcc -Wformat-nonliteral complains.
-rw-r--r--agent/tcf/framework/channel_tcp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/agent/tcf/framework/channel_tcp.c b/agent/tcf/framework/channel_tcp.c
index 3d33760..7b8bb4a 100644
--- a/agent/tcf/framework/channel_tcp.c
+++ b/agent/tcf/framework/channel_tcp.c
@@ -1047,10 +1047,10 @@ static void set_peer_addr(ChannelTCP * c, struct sockaddr * addr, int addr_len)
else
#endif
{
- char * fmt = (char *)(c->ssl != NULL ? "SSL:%s:%d" : "TCP:%s:%d");
char nbuf[128];
assert(addr->sa_family == AF_INET);
- snprintf(name, sizeof(name), fmt,
+ snprintf(name, sizeof(name), "%s:%s:%d",
+ c->ssl != NULL ? "SSL" : "TCP",
inet_ntop(addr->sa_family, &((struct sockaddr_in *)addr)->sin_addr, nbuf, sizeof(nbuf)),
ntohs(((struct sockaddr_in *)addr)->sin_port));
}