From 3f2bc64f166b9fa40757643589c86329cdaee136 Mon Sep 17 00:00:00 2001 From: Bert Gijsbers Date: Sat, 9 Nov 2024 20:55:09 +0100 Subject: [PATCH] Remove smart pointers from misc.cc. --- src/misc.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/misc.cc b/src/misc.cc index 0098deed9..a54eba219 100644 --- a/src/misc.cc +++ b/src/misc.cc @@ -31,7 +31,6 @@ #include "intl.h" #include "ascii.h" -#include "ypointer.h" using namespace ASCII; @@ -736,8 +735,9 @@ int process_close(FILE* fp, int pid) { void show_backtrace(const int limit) { #if defined(HAVE_BACKTRACE_SYMBOLS_FD) && defined(HAVE_EXECINFO_H) - const int asize = Elvis(limit, 20); - asmart array(new void*[asize]); + const int fixed = 40; + const int asize = (0 < limit) ? max(fixed, limit) : 20; + void *array[fixed]; const int count = backtrace(array, asize); const char tool[] = "/usr/bin/addr2line"; char* prog = progpath();