diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2012-07-08 18:09:54 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2012-10-02 22:14:45 -0700 |
commit | f0df23d778ae5b85745de0e48729b039b5b3f69a (patch) | |
tree | 578786bf7dfc5e90cf70591e230118b881a127ae /fd.c | |
parent | d5cc5b0e6b4e9cd1ee35e58069018f75bb0a3ed3 (diff) | |
download | xscope-f0df23d778ae5b85745de0e48729b039b5b3f69a.tar.gz |
Convert remaining sprintf calls to snprintf
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
Diffstat (limited to 'fd.c')
-rw-r--r-- | fd.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -313,7 +313,8 @@ MakeConnection(const char *server, short port, int report, /* determine the host machine for this process */ if (*server == '\0') { sun.sun_family = AF_UNIX; - sprintf(sun.sun_path, "/tmp/.X11-unix/X%d", port - 6000); + snprintf(sun.sun_path, sizeof(sun.sun_path), + "/tmp/.X11-unix/X%d", port - 6000); salen = sizeof(sun.sun_family) + strlen(sun.sun_path) + 1; saddr = (struct sockaddr *) &sun; } @@ -337,8 +338,9 @@ MakeConnection(const char *server, short port, int report, if (port == ScopePort && strcmp(server, ScopeHost) == 0) { char error_message[100]; - (void) sprintf(error_message, "Trying to attach to myself: %s,%d\n", - server, sin.sin_port); + snprintf(error_message, sizeof(error_message), + "Trying to attach to myself: %s,%d\n", + server, sin.sin_port); panic(error_message); } |