diff options
author | Alan Coopersmith <alan.coopersmith@sun.com> | 2008-06-20 20:28:39 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@sun.com> | 2008-06-20 20:28:39 -0700 |
commit | 551ac918a534d4754321cd917ae6086bf30cc2f5 (patch) | |
tree | ef78c12127ecaf0d329f9056da9b51f8a8699326 | |
parent | c1fbd8fb41328ded8eab0b7af9dbb3cf934ee966 (diff) |
Clear compiler warning and convert sprintf -> snprintf
-rw-r--r-- | helper/GetUrl.c | 6 |
1 files 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); |