From 551ac918a534d4754321cd917ae6086bf30cc2f5 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Fri, 20 Jun 2008 20:28:39 -0700 Subject: Clear compiler warning and convert sprintf -> snprintf --- helper/GetUrl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/helper/GetUrl.c b/helper/GetUrl.c index 2532122..9b8913f 100644 --- a/helper/GetUrl.c +++ b/helper/GetUrl.c @@ -112,11 +112,11 @@ OpenConnection(char *hostname, int port) XtransConnInfo trans_conn = NULL; /* transport connection object */ int connect_stat; char address[128]; /* address passed to the transport layer */ - char protocol[] = "tcp"; /* hardcoded transport */ + const char protocol[] = "tcp"; /* hardcoded transport */ /* make the address of the form: protocol/host:port */ - sprintf(address,"%s/%s:%d", - protocol ? protocol : "", + snprintf(address, sizeof(address), "%s/%s:%d", + protocol, hostname ? hostname : "", port); -- cgit v1.2.3