diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2011-09-25 11:39:13 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2011-10-01 08:55:58 -0700 |
commit | 0f942e5f015cb3270e6f2e17c308bee894cb5fe3 (patch) | |
tree | 43a19b887acfed7728068c6004e747943102f8af /Xtranssock.c | |
parent | eb9a8904fbef61a57ff01c90627ead57055ed62b (diff) |
Convert a bunch of sprintf calls to snprintf
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Diffstat (limited to 'Xtranssock.c')
-rw-r--r-- | Xtranssock.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Xtranssock.c b/Xtranssock.c index 1275196..955516d 100644 --- a/Xtranssock.c +++ b/Xtranssock.c @@ -840,7 +840,7 @@ set_sun_path(const char *port, const char *upath, char *path, int abstract) if (strlen(port) + strlen(upath) > maxlen) return -1; - sprintf(path, "%s%s%s", at, upath, port); + snprintf(path, sizeof(s.sun_path), "%s%s%s", at, upath, port); return 0; } #endif @@ -960,7 +960,7 @@ TRANS(SocketINETCreateListener) (XtransConnInfo ciptr, char *port, unsigned int { /* fixup the server port address */ tmpport = X_TCP_PORT + strtol (port, (char**)NULL, 10); - sprintf (portbuf,"%lu", tmpport); + snprintf (portbuf, sizeof(portbuf), "%lu", tmpport); port = portbuf; } #endif @@ -1457,7 +1457,7 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port) if (is_numeric (port)) { long tmpport = X_TCP_PORT + strtol (port, (char**)NULL, 10); - sprintf (portbuf, "%lu", tmpport); + snprintf (portbuf, sizeof(portbuf), "%lu", tmpport); port = portbuf; } #endif |