From bc62f8e983e913c8a37f3412466b8bc9d360b614 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Wed, 27 Oct 2004 05:53:07 +0000 Subject: Replace sprintf with snprintf svn:r2602 --- src/or/test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/or/test.c') diff --git a/src/or/test.c b/src/or/test.c index 5eec99ed9..fecf6be2b 100644 --- a/src/or/test.c +++ b/src/or/test.c @@ -50,7 +50,7 @@ setup_directory() int r; if (is_setup) return; - sprintf(temp_dir, "/tmp/tor_test_%d", (int) getpid()); + snprintf(temp_dir, sizeof(temp_dir), "/tmp/tor_test_%d", (int) getpid()); #ifdef MS_WINDOWS r = mkdir(temp_dir); #else @@ -69,7 +69,7 @@ get_fname(const char *name) { static char buf[1024]; setup_directory(); - sprintf(buf,"%s/%s",temp_dir,name); + snprintf(buf,sizeof(buf),"%s/%s",temp_dir,name); return buf; } -- cgit v1.2.3