summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-07-03 11:34:36 -0400
committerNick Mathewson <nickm@torproject.org>2018-07-03 11:34:36 -0400
commitfe8f7748202816a9b90e04db542e449145283a66 (patch)
tree978fd6aa21649485da78601728080a1fd3d74561 /src
parent77e678c20daf8633ce1904dd1df28398d820f7c0 (diff)
parentd0525c38d607504aee4ab8451d4651c2668997c0 (diff)
downloadtor-fe8f7748202816a9b90e04db542e449145283a66.tar.gz
tor-fe8f7748202816a9b90e04db542e449145283a66.zip
Merge branch 'bug26522'
Diffstat (limited to 'src')
-rw-r--r--src/lib/err/backtrace.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/lib/err/backtrace.c b/src/lib/err/backtrace.c
index 5f5ecd3c37..d18a595c34 100644
--- a/src/lib/err/backtrace.c
+++ b/src/lib/err/backtrace.c
@@ -35,6 +35,7 @@
#include <errno.h>
#include <stdlib.h>
#include <string.h>
+#include <stdio.h>
#ifdef HAVE_CYGWIN_SIGNAL_H
#include <cygwin/signal.h>
@@ -264,16 +265,12 @@ dump_stack_symbols_to_error_fds(void)
int
configure_backtrace_handler(const char *tor_version)
{
- char version[128];
- strncpy(version, "Tor", sizeof(version)-1);
+ char version[128] = "Tor\0";
if (tor_version) {
- strncat(version, " ", sizeof(version)-1);
- strncat(version, tor_version, sizeof(version)-1);
+ snprintf(version, sizeof(version), "Tor %s", tor_version);
}
- version[sizeof(version) - 1] = 0;
-
return install_bt_handler(version);
}