From 78265498b18490b3d623644612445eb556b3e5bb Mon Sep 17 00:00:00 2001 From: Tim Cava Date: Mon, 11 Nov 2013 21:23:51 +0000 Subject: [PATCH] Convert sprintf calls to snprintf. From pvaldes. git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@446 13b04d17-f746-0410-82c6-800466cd88b0 --- source/irc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/irc.c b/source/irc.c index 41c2343..07b459f 100644 --- a/source/irc.c +++ b/source/irc.c @@ -1398,7 +1398,7 @@ FILE *t; if (!do_check_pid) return; p = expand_twiddle(DEFAULT_CTOOLZ_DIR); - snprintf(pidfile, 79, "%s/pid.%s", p, nickname); + snprintf(pidfile, sizeof pidfile, "%s/pid.%s", p, nickname); if ((t = fopen(pidfile, "r"))) { char buffer[80]; @@ -1424,7 +1424,7 @@ FILE *t; if (!do_check_pid) return; p = expand_twiddle(DEFAULT_CTOOLZ_DIR); - snprintf(pidfile, 79, "%s/pid.%s", p, nickname); + snprintf(pidfile, sizeof pidfile, "%s/pid.%s", p, nickname); if ((t = fopen(pidfile, "r"))) { #if !defined(__EMX__) && !defined(WINNT) && !defined(GUI) @@ -1434,7 +1434,7 @@ FILE *t; if (save_ipc != -1 && (s = get_socket(save_ipc))) { char buf[500]; - sprintf(buf, s->server, s->port); + snprintf(buf, sizeof buf, s->server, s->port); unlink(buf); } #endif @@ -1649,7 +1649,7 @@ int main(int argc, char *argv[], char *envp[]) #ifdef CLOAKED initsetproctitle(argc, argv, envp); - sprintf(proctitlestr, CLOAKED); + snprintf(proctitlestr, sizeof proctitlestr, CLOAKED); setproctitle("%s", proctitlestr); #endif