summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@sun.com>2008-06-20 20:28:39 -0700
committerAlan Coopersmith <alan.coopersmith@sun.com>2008-06-20 20:28:39 -0700
commit551ac918a534d4754321cd917ae6086bf30cc2f5 (patch)
treeef78c12127ecaf0d329f9056da9b51f8a8699326
parentc1fbd8fb41328ded8eab0b7af9dbb3cf934ee966 (diff)
Clear compiler warning and convert sprintf -> snprintf
-rw-r--r--helper/GetUrl.c6
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);